示例#1
0
 public IEnumerable <Ingredient> GetAll()
 {
     if (AuthorizedUsers["GetAll"].SingleOrDefault(x => x == Role) != null)
     {
         return(IngredientController.GetAll());
     }
     else
     {
         return(null);
     }
 }
        public void Update()
        {
            Ingredients.Clear();

            using (IIngredientController controller = factory.CreateIngredientController())
            {
                DataControllerMessage <IEnumerable <IngredientDisplayDTO> > controllerMessage = controller.GetAll();

                if (controllerMessage.IsSuccess)
                {
                    foreach (IngredientDisplayDTO ingredient in controllerMessage.Data)
                    {
                        Ingredients.Add(ingredient);
                    }
                }
            }
        }