public InvoiceEntity Get_Object_Invoice_By_StoreID_And_CustomerID(string stoid, string cusid) { if (dbContext == null) { dbContext = new FoodDeliveryEntities(); } var obj = dbContext.GET_OBJECT_INVOICE_BY_STOREID_AND_CUSTOMERID(stoid, cusid).FirstOrDefault(); InvoiceEntity entity = new InvoiceEntity { 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, CustomerID = "" + obj.CustomerID, AddressDelivery = obj.AddressDelivery, CustomerName = obj.CustomerName, CustomerPhone = obj.CustomerPhone, Status = (int)obj.Status }; return(entity); }