예제 #1
0
        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();
        }
예제 #2
0
        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();
        }