鼎鼎知识库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

智能照明局域网连接云端.md 2.1KB

преди 4 години
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. - 完成TDengine的连接
  2. - 在`DD.Electricity.Cloud.PrPersistence`项目中生成数据库
  3. ```
  4. - appsettings.json中配置连接字符串
  5. - GlobalSettings.cs 把appsettings.json中的连接key放这里
  6. - DesignTimeDbContextFactoryBase中Create方法中的配置
  7. - dotnet ef database update -c ProjectDbContext
  8. ```
  9. - 反向工程到局域网项目
  10. ```
  11. - 局域网增加类库:TaiHe.Electricity.Cloud
  12. <ItemGroup>
  13. <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
  14. <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
  15. <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.4" />
  16. <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.2.0" />
  17. <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
  18. <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
  19. <PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
  20. </ItemGroup>
  21. - 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
  22. - 网站项目引用类库:TaiHe.Electricity.Cloud,发现类库的版本高了,类库需要降低版本。不仅仅是组件版本问题。以下可以:
  23. <PropertyGroup>
  24. <TargetFramework>netcoreapp2.0</TargetFramework>
  25. </PropertyGroup>
  26. <ItemGroup>
  27. <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.3" />
  28. <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.3" />
  29. <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.0.1" />
  30. <PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.0" />
  31. </ItemGroup>
  32. - appsettings.json配置连接字符串
  33. - Startup.cs配置上下文
  34. ```
  35. - DD.Electricity.Cloud创建集团和项目
  36. ```
  37. groupid:
  38. projectid:
  39. connkey:dingding_zhanting
  40. ```
  41. - 局域网appsettings.json配置