init
This commit is contained in:
parent
8503d0f0a6
commit
4bb3441145
15
RIZO上海干巷总装车间线边库.slnLaunch
Normal file
15
RIZO上海干巷总装车间线边库.slnLaunch
Normal file
@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"Name": "新建配置文件",
|
||||
"Projects": [
|
||||
{
|
||||
"Path": "Server\\RIZO.Server.Start\\RIZO.Server.Start.csproj",
|
||||
"Action": "Start"
|
||||
},
|
||||
{
|
||||
"Path": "Client\\RIZO.Client.Start\\RIZO.Client.Start.csproj",
|
||||
"Action": "Start"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -9,6 +9,8 @@ namespace RIZO.Server.EFContext
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
public EFCoreContext CreateDBContext()
|
||||
{
|
||||
return new EFCoreContext(_configuration.Read("DBConnectStr"));
|
||||
|
||||
@ -19,7 +19,10 @@ namespace RIZO.Server.EFCore
|
||||
}
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSqlServer(strConn);
|
||||
//optionsBuilder.UseSqlServer(strConn);
|
||||
// MySQL 配置(使用 Pomelo 提供程序)
|
||||
optionsBuilder.UseMySql(strConn,
|
||||
ServerVersion.AutoDetect(strConn));
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MySql.EntityFrameworkCore" Version="5.0.0" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -18,4 +18,8 @@
|
||||
<ProjectReference Include="..\RIZO.Server.Models\RIZO.Server.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"DBConnectStr": "Server=127.0.0.1;Database=zx_sp_record;User Id=sa;Password=123456;",
|
||||
"DBConnectStr": "Server=139.224.232.211;Database=rizo_xbp;User Id=root;Password=doantech123;Port=3308"
|
||||
//"ConnectionStrings": {
|
||||
|
||||
// "MySqlConnection": "server=localhost;database=your_database;user=root;password=your_password"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user