Entities + Configuration base
This commit is contained in:
@@ -46,8 +46,14 @@ namespace WorkFlowCheck.DL
|
|||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
modelBuilder.ApplyConfiguration(new CheckListHeaderTypeConfiguration());
|
||||||
|
modelBuilder.ApplyConfiguration(new CheckListTemplateHeaderTypeConfiguration());
|
||||||
|
modelBuilder.ApplyConfiguration(new CheckListTemplateRowTypeConfiguration());
|
||||||
|
modelBuilder.ApplyConfiguration(new CheckPointTypeConfiguration());
|
||||||
modelBuilder.ApplyConfiguration(new EquipmentTypeConfiguration());
|
modelBuilder.ApplyConfiguration(new EquipmentTypeConfiguration());
|
||||||
modelBuilder.ApplyConfiguration(new LocationTypeConfiguration());
|
modelBuilder.ApplyConfiguration(new LocationTypeConfiguration());
|
||||||
|
modelBuilder.ApplyConfiguration(new RoleTypeConfiguration());
|
||||||
|
modelBuilder.ApplyConfiguration(new UsersCheckListTemplateHeaderTypeConfiguration());
|
||||||
modelBuilder.ApplyConfiguration(new UserTypeConfiguration());
|
modelBuilder.ApplyConfiguration(new UserTypeConfiguration());
|
||||||
|
|
||||||
modelBuilder.RegisterSoftDeleteQueryFilters();
|
modelBuilder.RegisterSoftDeleteQueryFilters();
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WorkFlowCheck.DL.Configurations
|
||||||
|
{
|
||||||
|
public class CheckListHeaderTypeConfiguration : IEntityTypeConfiguration<Entities.CheckListHeader>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<Entities.CheckListHeader> builder)
|
||||||
|
{
|
||||||
|
builder.ToTable("CheckListHeader");
|
||||||
|
builder.HasKey(e => e.Id);
|
||||||
|
builder.Property(e => e.Id).ValueGeneratedOnAdd();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WorkFlowCheck.DL.Configurations
|
||||||
|
{
|
||||||
|
public class CheckListTemplateHeaderTypeConfiguration : IEntityTypeConfiguration<Entities.CheckListTemplateHeader>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<Entities.CheckListTemplateHeader> builder)
|
||||||
|
{
|
||||||
|
builder.ToTable("CheckListTemplateHeader");
|
||||||
|
builder.HasKey(e => e.Id);
|
||||||
|
builder.Property(e => e.Id).ValueGeneratedOnAdd();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WorkFlowCheck.DL.Configurations
|
||||||
|
{
|
||||||
|
public class CheckListTemplateRowTypeConfiguration : IEntityTypeConfiguration<Entities.CheckListTemplateRow>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<Entities.CheckListTemplateRow> builder)
|
||||||
|
{
|
||||||
|
builder.ToTable("CheckListTemplateRow");
|
||||||
|
builder.HasKey(e => e.Id);
|
||||||
|
builder.Property(e => e.Id).ValueGeneratedOnAdd();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WorkFlowCheck.DL.Configurations
|
||||||
|
{
|
||||||
|
public class CheckPointTypeConfiguration : IEntityTypeConfiguration<Entities.CheckPoint>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<Entities.CheckPoint> builder)
|
||||||
|
{
|
||||||
|
builder.ToTable("CheckPoint");
|
||||||
|
builder.HasKey(e => e.Id);
|
||||||
|
builder.Property(e => e.Id).ValueGeneratedOnAdd();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user