public List <ListTypeModel> GetAll() { List <ListTypeModel> list = null; _dataProvider.ExecuteCmd("dbo.SystemDictionary_SelectAll" , inputParamMapper : null , singleRecordMapper : delegate(IDataReader reader, short set) { ListTypeModel singleItem = new ListTypeModel(); int startingIndex = 0; //startingOrdinal singleItem.Id = reader.GetSafeInt32(startingIndex++); singleItem.ItemValue = reader.GetSafeString(startingIndex++); singleItem.CreatedUserID = reader.GetSafeInt32(startingIndex++); singleItem.CreatedTime = reader.GetSafeDateTime(startingIndex++); //not going to create list if there's no data / lazy load / if statement if (list == null) { list = new List <ListTypeModel>(); } list.Add(singleItem); }); return(list); }
public ActionResult Index(string parentAscii, string ascii) { parentAscii = "san-pham"; ascii = "san-pham"; var type = productTypeRepositoryFE.GetByParentAsciiAndAscii(parentAscii, ascii); var homeModel = new ListTypeModel() { Type = type, ListProductType = productTypeRepositoryFE.GetListByParent(type.ID), ListProduct = productRepositoryFE.GetListByTypeAscii(0, 10, ascii) }; return(View(homeModel)); }