public ResultViewModel <InvoiceItemEditViewModel> Add(InvoiceItemEditViewModel emp) { ResultViewModel <InvoiceItemEditViewModel> result = new ResultViewModel <InvoiceItemEditViewModel>(); try { if (!ModelState.IsValid) { result.Message = "In Valid Model State"; } else { InvoiceItemEditViewModel selectedEmp = InvoiceItemService.Add(emp); result.Successed = true; result.Data = selectedEmp; } } catch (Exception ex) { result.Successed = false; result.Message = "Semething Went Wrong"; } return(result); }
public async Task <int> Add(AddInvoiceItemDto addInvoiceItemDto) { return(await _service.Add(addInvoiceItemDto)); }