public override void EnsureSeeded() { var csvConfig = new CsvConfiguration { Delimiter = "|", SkipEmptyRecords = true, TrimFields = true, TrimHeaders = true, WillThrowOnMissingField = false }; SeederConfiguration.ResetConfiguration(csvConfig, null, typeof(SettingsContext).GetTypeInfo().Assembly); Dockets.SeedDbSetIfEmpty($"{nameof(Dockets)}"); CentralRegistries.SeedDbSetIfEmpty($"{nameof(CentralRegistries)}"); EmrSystems.SeedDbSetIfEmpty($"{nameof(EmrSystems)}"); DatabaseProtocols.SeedDbSetIfEmpty($"{nameof(DatabaseProtocols)}"); RestProtocols.SeedDbSetIfEmpty($"{nameof(RestProtocols)}"); Resources.SeedDbSetIfEmpty($"{nameof(Resources)}"); var ex = Extracts.Where(e => e.EmrSystemId.ToString() == "a62216ee-0e85-11e8-ba89-0ed5f89f718b" || e.EmrSystemId.ToString() == "a6221856-0e85-11e8-ba89-0ed5f89f718b" || e.EmrSystemId.ToString() == "a6221857-0e85-11e8-ba89-0ed5f89f718b" ); Extracts.RemoveRange(ex); Extracts.SeedFromResource($"{nameof(Extracts)}"); SaveChanges(); }
public override void EnsureSeeded() { var csvConfig = new Configuration() { Delimiter = "|" }; SeederConfiguration.ResetConfiguration(csvConfig, null, typeof(HtsContext).GetTypeInfo().Assembly); // MasterFacilities.SeedDbSetIfEmpty($"{nameof(MasterFacility)}"); Dockets.SeedDbSetIfEmpty($"{nameof(Docket)}"); SaveChanges(); Subscribers.SeedDbSetIfEmpty($"{nameof(Subscriber)}"); SaveChanges(); }
public override void EnsureSeeded() { var csvConfig = new CsvConfiguration { Delimiter = "|", SkipEmptyRecords = true, TrimFields = true, TrimHeaders = true, WillThrowOnMissingField = false }; SeederConfiguration.ResetConfiguration(csvConfig, null, typeof(CbsContext).GetTypeInfo().Assembly); MasterFacilities.SeedDbSetIfEmpty($"{nameof(MasterFacility)}"); Dockets.SeedDbSetIfEmpty($"{nameof(Docket)}"); SaveChanges(); Subscribers.SeedDbSetIfEmpty($"{nameof(Subscriber)}"); SaveChanges(); }
public override void EnsureSeeded() { var csvConfig = new CsvConfiguration { Delimiter = "|", SkipEmptyRecords = true, TrimFields = true, TrimHeaders = true, WillThrowOnMissingField = false }; SeederConfiguration.ResetConfiguration(csvConfig, null, typeof(SettingsContext).GetTypeInfo().Assembly); Dockets.SeedDbSetIfEmpty($"{nameof(Dockets)}"); CentralRegistries.SeedDbSetIfEmpty($"{nameof(CentralRegistries)}"); EmrSystems.SeedDbSetIfEmpty($"{nameof(EmrSystems)}"); DatabaseProtocols.SeedDbSetIfEmpty($"{nameof(DatabaseProtocols)}"); Extracts.SeedDbSetIfEmpty($"{nameof(Extracts)}"); SaveChanges(); }
public override void EnsureSeeded() { Log.Debug("seeding..."); if (!MasterFacilities.Any()) { var data = SeedDataReader.ReadCsv <MasterFacility>(typeof(MnchContext).Assembly, "Seed", "|"); MasterFacilities.AddRange(data); } if (!Dockets.Any()) { var data = SeedDataReader.ReadCsv <Docket>(typeof(MnchContext).Assembly, "Seed", "|"); Dockets.AddRange(data); } if (!Subscribers.Any()) { var data = SeedDataReader.ReadCsv <Subscriber>(typeof(MnchContext).Assembly, "Seed", "|"); Subscribers.AddRange(data); } SaveChanges(); Log.Debug("seeding DONE"); }