public StorageRepository(string connectionString, IRepositoryContextFactory contextFactory) : base(connectionString, contextFactory) { DefaultData defaultData = new DefaultData(); using (var context = ContextFactory.CreateDBContext(ConnectionString)) { if (!context.LocationTypes.Any()) { defaultData.InitLocationTypes(ContextFactory, ConnectionString); } if (!context.Locations.Any()) { defaultData.InitLocations(ContextFactory, ConnectionString); } if (!context.EquipmentTypes.Any()) { defaultData.InitEquipTypes(ContextFactory, ConnectionString); } } }