public Warehouse GetWarehouse(int PriceTypeID) { var result = new Warehouse(); using (var reader = GetContext().GetReader(@" SELECT * FROM Warehouses WHERE WarehouseID = {0} ", PriceTypeID)) { if(!reader.Read()) return null; result.WarehouseID = reader.GetInt32("WarehouseID"); result.WarehouseDescription = reader.GetString("WarehouseDescription"); } return result; }
public Warehouse GetWarehouse(int WarehouseID) { var result = new Warehouse(); var response = GetContext().Warehouses .Where(c => c.WarehouseID == WarehouseID) .FirstOrDefault(); if(response == null) return null; result.WarehouseID = response.WarehouseID; result.WarehouseDescription = response.WarehouseDescription; return result; }