Example #1
0
 public static DboSalesEntry FromModel(SalesEntry salesEntry)
 {
     return(new DboSalesEntry
     {
         Id = Guid.NewGuid(),
         TimeOfSale = salesEntry.TimeOfSale,
         ArticleNumber = salesEntry.ArticleNumber,
         Price = salesEntry.Price
     });
 }
 public Task AddSaleEntry(SalesEntry saleEntry)
 {
     _entries.Add(saleEntry);
     return(Task.CompletedTask);
 }
 public async Task AddSaleEntry(SalesEntry saleEntry)
 {
     _context.SalesEntries.Add(DboSalesEntry.FromModel(saleEntry));
     await _context.SaveChangesAsync();
 }