- 完成TDengine的连接
- 在
DD.Electricity.Cloud.PrPersistence
项目中生成数据库
- appsettings.json中配置连接字符串
- GlobalSettings.cs 把appsettings.json中的连接key放这里
- DesignTimeDbContextFactoryBase中Create方法中的配置
- dotnet ef database update -c ProjectDbContext
- 局域网增加类库:TaiHe.Electricity.Cloud
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
</ItemGroup>
- dotnet ef dbcontext scaffold "server=47.103.61.198;port=3306;database=dingding_zhanting;user=root;password=TecheDing2019;SslMode=none" Pomelo.EntityFrameworkCore.MySql --schema database=dingding_zhanting -c CloudContext -o Cloud
- 网站项目引用类库:TaiHe.Electricity.Cloud,发现类库的版本高了,类库需要降低版本。不仅仅是组件版本问题。以下可以:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.3" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.0" />
</ItemGroup>
- appsettings.json配置连接字符串
- Startup.cs配置上下文
- DD.Electricity.Cloud创建集团和项目
groupid:
projectid:
connkey:dingding_zhanting