DD.WellWorkover.Cloud/AsbCloudDb/Model/DefaultData/DefaultContextData.cs

42 lines
1.8 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
2022-11-25 09:34:20 +05:00
using System;
using System.Collections.Generic;
namespace AsbCloudDb.Model.DefaultData
{
public static class DefaultContextData
{
public static Dictionary<Type, IEntityFiller> GetFillers()
{
var fillers = new Dictionary<Type, IEntityFiller>
{
// Order does meter
{ typeof(UserRole), new EntityFillerUserRole() },
{ typeof(RelationUserRoleUserRole), new EntityFillerRelationUserRoleUserRole()},
{ typeof(Permission), new EntityFillerPermission()},
{ typeof(RelationUserRolePermission), new EntityFillerRelationUserRolePermission()},
{ typeof(User), new EntityFillerUser()},
{ typeof(RelationUserUserRole), new EntityFillerRelationUserUserRole()},
{ typeof(Company), new EntityFillerCompany()},
{ typeof(WellOperationCategory), new EntityFillerWellOperationCategory()},
{ typeof(FileCategory), new EntityFillerFileCategory()},
{ typeof(WellSectionType), new EntityFillerWellSectionType()},
{ typeof(WellType), new EntityFillerWellType()},
{ typeof(MeasureCategory), new EntityFillerMeasureCategory()},
{ typeof(CompanyType), new EntityFillerCompanyType()},
{ typeof(Subsystem), new EntityFillerSubsystem() },
{ typeof(NotificationCategory), new EntityNotificationCategory()},
2022-11-25 09:34:20 +05:00
};
return fillers;
}
public static void Fill(ModelBuilder modelBuilder)
{
var fillers = GetFillers();
foreach (var filler in fillers.Values)
filler.FillData(modelBuilder);
}
}
}