using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; namespace AsbCloudDb.Model.DefaultData { public static class DefaultContextData { public static Dictionary GetFillers() { var fillers = new Dictionary { // 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(AsbCloudDb.Model.Subsystems.Subsystem), new EntityFillerSubsystem() }, }; return fillers; } public static void Fill(ModelBuilder modelBuilder) { var fillers = GetFillers(); foreach (var filler in fillers.Values) filler.FillData(modelBuilder); } } }