Example #1
0
        public TaxImporter(TaxesContext taxes)
        {
            this.db = taxes;

            csvConfiguration = new CsvConfiguration();
            csvConfiguration.RegisterClassMap <TaxMap>();
            csvConfiguration.HasHeaderRecord  = true;
            csvConfiguration.TrimFields       = true;
            csvConfiguration.Delimiter        = ";";
            csvConfiguration.SkipEmptyRecords = true;
            TypeConverterFactory.AddConverter <double>(new DoubleConverter());
        }
Example #2
0
 public static IHostBuilder CreateHostBuilder(string[] args) =>
 Host.CreateDefaultBuilder(args)
 .ConfigureWebHostDefaults(webBuilder =>         //Seed Data
 {
     var db = new TaxesContext();
     db.TaxesItem.Add(new TaxesItem
     {
         Id            = 1,
         Municipality  = "istanbul",
         Date          = DateTime.UtcNow,
         TaxesSchedule = "yearly",
         TaxesRatio    = 4
     });
     db.TaxesItem.Add(new TaxesItem {
         Id            = 2,
         Municipality  = "berlin",
         Date          = DateTime.UtcNow.AddDays(-60),
         TaxesSchedule = "daily",
         TaxesRatio    = 2
     });
     db.SaveChanges();
     db.Dispose();
     webBuilder.UseStartup <Startup>();
 });
Example #3
0
 public TaxesController(TaxesContext context, ITaxesService businessService, IMapper mapper)
 {
     _context         = context;
     _businessService = businessService;
     _mapper          = mapper;
 }
Example #4
0
 public Worker(TaxesContext taxes)
 {
     this.db = taxes;
 }
Example #5
0
 public TaxesService(TaxesContext context)
 {
     _context = context;
 }