示例#1
0
        public List <RecipeIndexViewModel> GetAllForAdmin()
        {
            //Do validation here
            var list = rp.GetAllForAdmin();
            List <RecipeIndexViewModel> vmList = new List <RecipeIndexViewModel>();

            foreach (var item in list)
            {
                vmList.Add(new RecipeIndexViewModel
                {
                    RecipeId    = item.RecipeId,
                    RecipeName  = item.Name,
                    BeerDesc    = item.Description,
                    BeerMake    = item.Making,
                    BeerType    = orp.GetBeerType(item.BeerTypeId).BeerType1,
                    OwnerNick   = mrp.GetById(item.PostedBy).Username,
                    Ingredients = irp.GetRecipeIngredients(item.RecipeId)
                });
            }
            return(vmList);
        }