Exemple #1
0
        private RecipeShoppingListItemModel GetRecipeShoppingListItem(DbRecipeShoppingListItem item)
        {
            if (item == null)
            {
                return(null);
            }

            return(new RecipeShoppingListItemModel
            {
                NrOfPersons = item.NrOfPersons,
                RecipeId = item.RecipeId,
                RecipeName = item.Recipe.Name
            });
        }
Exemple #2
0
 private RecipeShoppingListItemModel ConvertRecipeItem(DbRecipeShoppingListItem recipeItem)
 {
     if (recipeItem == null)
     {
         return(null);
     }
     return(new RecipeShoppingListItemModel
     {
         NrOfPersons = recipeItem.NrOfPersons,
         RecipeId = recipeItem.RecipeId,
         ShoppingListItemId = recipeItem.ShoppingListItemId,
         RecipeName = recipeItem.Recipe.Name,
         IsOnlyUnavailable = recipeItem.IsOnlyUnavailable
     });
 }