public List <InventoryReport> GetUsedInventoryList() { List <InventoryReport> list = new List <InventoryReport>(); using (_ctx = new GuildCarsEntities()) { try { var newList = _ctx.UsedInventoryReport(); foreach (var car in newList) { InventoryReport report = new InventoryReport(); report.Year = car.Year; report.CarMake = car.MakeName; report.CarModel = car.ModelName; report.Count = car.TotalVehicles; report.StockValue = car.TotalValue; list.Add(report); } } catch (Exception ex) { throw ex; } return(list); } }