public IHttpActionResult getOrdersByCustomer(int id) { BackendTestEntities backendTestEntities = new BackendTestEntities(); IList <SPgetOrdersByCustomer> getCus = backendTestEntities.spGetActiveOrdersByCustomer(id).Select(x => new SPgetOrdersByCustomer() { UserName = x.UserName, ProductName = x.ProductName, UnitPrice = x.UnitPrice, SupplierName = x.SupplierName, OrderStatus = x.OrderStatus, OrderTyoe = x.OrderType, OrderedOn = x.OrderedOn, ShippedOn = x.ShippedOn }).ToList(); return(Ok(getCus)); }