Exemplo n.º 1
0
 public RecipeIngredientListModel MapRecipeIngredientEntityToListModel(RecipeIngredientEntity recipeIngredientEntity)
 {
     return(new RecipeIngredientListModel
     {
         Id = recipeIngredientEntity.Id,
         Amount = recipeIngredientEntity.Amount,
         AmountUnitAbbreviation = recipeIngredientEntity.AmountUnit.Abbreviation,
         IngredientName = recipeIngredientEntity.Ingredient.Name
     });
 }
Exemplo n.º 2
0
 // RecipeIngredient models and entity mappings.
 public RecipeIngredientDetailModel MapRecipeIngredientEntityToDetailModel(RecipeIngredientEntity recipeIngredientEntity)
 {
     return(new RecipeIngredientDetailModel
     {
         Id = recipeIngredientEntity.Id,
         Amount = recipeIngredientEntity.Amount,
         AmountUnit = MapAmountUnitEntityToDetailModel(recipeIngredientEntity.AmountUnit),
         Ingredient = MapIngredientEntityToDetailModel(recipeIngredientEntity.Ingredient)
     });
 }