更新控制器
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Yi.Framework.Model
|
||||
{
|
||||
//Add-Migration yi-1
|
||||
//Update-Database yi-1
|
||||
public class DataContext : DbContext
|
||||
public partial class DataContext : DbContext
|
||||
{
|
||||
private readonly IOptionsMonitor<SqliteOptions> _optionsMonitor;
|
||||
private readonly string _connStr;
|
||||
|
||||
@@ -11,5 +11,24 @@
|
||||
string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径
|
||||
Assembly assembly = Assembly.LoadFrom(System.IO.Path.Combine(solutionsPath, @"Yi.Framework.ApiMicroservice\bin\Debug\net5.0\Yi.Framework.Model.dll"));
|
||||
Type[] ts = assembly.GetTypes();
|
||||
|
||||
|
||||
#>
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model
|
||||
{
|
||||
public partial class BaseContext :DbContext
|
||||
{
|
||||
<# foreach(var item in ts){
|
||||
|
||||
#>
|
||||
public DbSet<<#=item#>> <#=item#> { get; set; }
|
||||
<# } #>
|
||||
}
|
||||
}
|
||||
@@ -8,14 +8,6 @@
|
||||
<Folder Include="Search\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="T4DaraContext.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>T4DaraContext.tt</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.10" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user