I am trying to grab a single column from my linq query and put it into another list may not be the right way of doing it so please excuse me if my code is not good. Wanting to learn more about linq.
List<StockM> _stockm = new List<StockM>();
List<priceLists> _priceList = new List<priceLists>();
stockm = _db.getStockBySupplierCode(_supplierCode);
foreach (var stockitem in _stockm)
{
_priceList = _db.getPriceTypesByProductCode(stockitem.product, "LPS");
stockitem.lpePrice = Convert.ToDecimal(_priceList.Select(s => s.lpsPrice));
}
I think the probelems lies in how I am attempting to select the column out here
_priceList.Select(s => s.lpsPrice)