public ItemViewModel GetItemByID(int id) { Item item = new Item(); ItemViewModel itemVM = new ItemViewModel(); ItemBLL iBLL = new ItemBLL(); item = iBLL.GetItemByID(id); itemVM = AutoMapper.Mapper.Map<Item, ItemViewModel>(item); return itemVM; }
public List<ItemViewModel> GetAllItems() { List<Item> itemList = new List<Item>(); List<ItemViewModel> itemVMList = new List<ItemViewModel>(); ItemBLL iBLL = new ItemBLL(); itemList = iBLL.GetAllItems(); itemVMList = AutoMapper.Mapper.Map<List<Item>, List<ItemViewModel>>(itemList); return itemVMList; }