//DataEntities d = new DataEntities(); //public List<DescriptionOfItem> getDescriptionByItemName(string name) //{ // List<DescriptionOfItem> DescriptionOfItemList = new List<DescriptionOfItem>(); // Item item = new Item(); // item=getItembyitemName // DescriptionOfItemList=d.DescriptionOfItem.Where() // return //} public static List <DescriptionOfItemDTO> getDescriptionOfItemListByItemId(int itemId) { DataEntities d = new DataEntities(); List <DescriptionOfItemDTO> descriptionOfItemList = new List <DescriptionOfItemDTO>(); foreach (var x in d.DescriptionOfItem) { if (x.ItemId == itemId || x.ItemId == 1) { descriptionOfItemList.Add(DescriptionOfItemDTO.ConvertToDTO(x)); } } //descriptionOfItemList = DescriptionOfItemDTO.ConvertToListOfDTO(d.DescriptionOfItem.Where(x => x.ItemId == itemId || x.ItemId==1).ToList()); return(descriptionOfItemList); }
public static List <int> addDiscreptionOfItemList(List <DescriptionOfItemDTO> descriptionOfItemDTOList) { return(DescriptionOfItemDTO.ConvertFromListOfDTO(descriptionOfItemDTOList).Select(x => x.DescriptionOfItemId).ToList()); }