public static async Task PopulateDictionaries(IApplicationBuilder app) { DictionaryDbContext context = app.ApplicationServices.GetRequiredService <DictionaryDbContext>(); if (!context.DocumentTypes.Any(dt => dt.DocumentKind == DocumentKind.SalesOrder)) { context.DocumentTypes.Add(new DocumentType { Code = "SportsStore.SalesOrder", Symbol = "ZS", Name = "Zamówienie sprzedaży", DocumentKind = DocumentKind.SalesOrder }); } if (!context.DocumentTypes.Any(dt => dt.DocumentKind == DocumentKind.Receipt)) { context.DocumentTypes.Add(new DocumentType { Code = "SportsStore.Receipt", Symbol = "PAR", Name = "Paragon", DocumentKind = DocumentKind.Receipt }); } if (!context.DocumentTypes.Any(dt => dt.DocumentKind == DocumentKind.SalesInvoice)) { context.DocumentTypes.Add(new DocumentType { Code = "SportsStore.SalesInvoice", Symbol = "FS", Name = "Faktura sprzedaży", DocumentKind = DocumentKind.SalesInvoice }); } if (!context.VatRates.Any()) { context.VatRates.Add(new VatRate { Symbol = "A", Value = 0.23m }); } context.SaveChanges(); }
public TermRepository(DictionaryDbContext dbContext) : base(dbContext) { }
public DocumentTypeRepository(DictionaryDbContext context) { _context = context; }
public VatRateRepository(DictionaryDbContext context, IProductRepository productRepo, IOrderRepository orderRepo) { _context = context; _productRepository = productRepo; _orderRepository = orderRepo; }
public DictionaryService(DictionaryDbContext context) { _context = context; }
protected GenericRepository(DictionaryDbContext dbContext) { this.DictionaryDbContext = dbContext; this.DbSet = dbContext.Set <T>(); }
public DictionaryController(IDictionaryService dictionaryService, DictionaryDbContext dictionaryDbContext, ICurrentUserAccessor currentUserAccessor) { _dictionaryService = dictionaryService; _dictionaryDbContext = dictionaryDbContext; _currentUserAccessor = currentUserAccessor; }
public AccountController(IConfiguration configuration, DictionaryDbContext dictionaryDbContext) { _configuration = configuration; _dictionaryDbContext = dictionaryDbContext; }