private RecipeCellViewModel ToViewModel(IShoppingListRecipeItem item) =>
 new RecipeCellViewModel(
     recipeDetails.Get(item.RecipeId).Get(),
     item.PersonCount.ToOption(),
     new UserAction <IRecipe>(_ => Cook(item), Icon.Done(), 1),
     new UserAction <IRecipe>(_ => Cook(item), Icon.CartRemove(), 2)    // TODO: Implement remove action
     );
예제 #2
0
 public ShoppingListRecipeItemWithDetail(RecipeDetail detail, IShoppingListRecipeItem shoppingListRecipeItem)
 {
     Detail = detail;
     ShoppingListRecipeItem = shoppingListRecipeItem;
 }
        // Cook recipe

        private Task <IOption <UserMessage> > Cook(IShoppingListRecipeItem item) =>
        ShoppingListHandler.Cook(CurrentAccount, item)
        .Map(r => ProcessResult(r))
        .Execute(environment);