public RecipeIngredientListModel MapRecipeIngredientEntityToListModel(RecipeIngredientEntity recipeIngredientEntity) { return(new RecipeIngredientListModel { Id = recipeIngredientEntity.Id, Amount = recipeIngredientEntity.Amount, AmountUnitAbbreviation = recipeIngredientEntity.AmountUnit.Abbreviation, IngredientName = recipeIngredientEntity.Ingredient.Name }); }
// 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) }); }