public async Task CreateAsync(InvoiceDetailViewModel model) { var entity = mapper.Map(model, new InvoiceDetail()); invoiceDetailRepository.Add(entity); await invoiceDetailRepository.SaveChangesAsync(); dataAccess.AddInvoiceTotalPrice(entity.InvoiceId.Value, entity.TotalPrice.Value); }