forked from ddrilling/AsbCloudServer
Степанов Дмитрий Александрович
399a8a6c59
1. Добавил флаг прочитано ли уведомление 2. Добавил новые миграции
43 lines
1.9 KiB
C#
43 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
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(Subsystems.Subsystem), new EntityFillerSubsystem() },
|
|
{ typeof(NotificationCategory), new EntityNotificationCategory()},
|
|
{ typeof(NotificationTransport), new EntityNotificationTransport() }
|
|
};
|
|
return fillers;
|
|
}
|
|
|
|
public static void Fill(ModelBuilder modelBuilder)
|
|
{
|
|
var fillers = GetFillers();
|
|
|
|
foreach (var filler in fillers.Values)
|
|
filler.FillData(modelBuilder);
|
|
}
|
|
}
|
|
}
|