public ActionResult DeleteLineItem(int id) { //_salesInvoiceService.DeleteLineItemById(id); //return RedirectToAction("Index", "SalesInvoices"); var lineItem = _salesInvoiceService.FindLineItemById(id); var salesInvoice = _salesInvoiceService.FindById(lineItem.SalesInvoiceId); //productReceive.ProductReceiveLineItems.Remove(lineItem); _salesInvoiceService.DeleteInvoiceLineItem(salesInvoice, lineItem); return(RedirectToAction("Create", "SalesInvoices", new { id = salesInvoice.SalesInvoiceId })); }