Initial commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.2.22153.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-preview.2.22153.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,26 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Model.Website;
|
||||
using Model.Work.Git;
|
||||
using Model.Work.Tasks;
|
||||
|
||||
namespace Contexts;
|
||||
|
||||
public class DatabaseContext : DbContext {
|
||||
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options) {
|
||||
Database.EnsureCreated();
|
||||
}
|
||||
|
||||
public DbSet<SprintModel> SprintModels { get; set; }
|
||||
public DbSet<TaskModel> TaskModels { get; set; }
|
||||
public DbSet<ChangeModel> ChangeModels { get; set; }
|
||||
public DbSet<PatchModel> PatchModels { get; set; }
|
||||
public DbSet<WebPageModel> WebPageModels { get; set; }
|
||||
public DbSet<WebSectionModel> WebSectionModels { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder) {
|
||||
modelBuilder.Entity<PatchModel>();
|
||||
modelBuilder.Entity<TaskModel>();
|
||||
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user