public void CreateMunicipalityTaxRecord(MunicipalityTaxRecord MunicipalityTaxRecord)
 {
     dbContext.MunicipalityTaxRecordes.Add(MunicipalityTaxRecord);
     try
     {
         dbContext.SaveChanges();
     }
     catch (DbUpdateException e)
     {
         throw new MunicipalityTaxRecordUpdateException("Could not create MunicipalityTaxRecord in database. ", e);
     }
 }
예제 #2
0
        // creating data for in-memory database.
        private static void AddTestData(MunicipalityTaxRecordContext context)
        {
            var MS = new MunicipalityTaxRecord
            {
                MunicipalityName = "Copenhegen",
                ScheduleStart    = new DateTime(2016, 01, 01),
                ScheduleEnd      = new DateTime(2016, 12, 31),
                TaxRate          = new decimal(0.1),
                Period           = TimePeriod.Year
            };

            context.MunicipalityTaxRecordes.Add(MS);
            context.SaveChanges();
        }