public List <InvoiceHistory> Get_List_Invoice_By_CustomerID_All(string id) { List <InvoiceHistory> list = new List <InvoiceHistory>(); if (dbContext == null) { dbContext = new FoodDeliveryEntities(); } var listvar = dbContext.GET_LIST_INVOICE_BY_CUSTOMERID_ALL(id).ToList(); foreach (var obj in listvar) { InvoiceHistory entity = new InvoiceHistory { InvoiceID = "" + obj.InvoiceID, OrderDate = "" + obj.OrderDate, DeliveryDate = "" + obj.DeliveryDate, Sale = (decimal)obj.Sale, ServiceChange = (decimal)obj.ServiceChange, ShippingFee = (decimal)obj.ShippingFee, TotalPrice = (decimal)obj.TotalPrice, StoreID = "" + obj.StoreID, StoreName = obj.StoreName, StoreAddress = obj.Address, CustomerID = "" + obj.CustomerID, AddressDelivery = obj.AddressDelivery, CustomerName = obj.CustomerName, CustomerPhone = obj.CustomerPhone, Status = (int)obj.Status }; list.Add(entity); } return(list); }