示例#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();
        }
示例#3
0
 public void AddProtocol(DatabaseProtocol protocol)
 {
     protocol.EmrSystemId = Id;
     DatabaseProtocols.Add(protocol);
 }