Beispiel #1
0
 public static Ingredient ToIngredient(Ingredients dtoIngredient, IngredientMetadata metadata = null)
 {
     return(new Ingredient
     {
         Id = dtoIngredient.IngredientId,
         ConversionType = dtoIngredient.ConversionType,
         Name = dtoIngredient.DisplayName,
         UnitName = dtoIngredient.UnitName,
         UnitWeight = dtoIngredient.UnitWeight,
         Metadata = (metadata != null ? IngredientMetadata.ToIngredientMetadata(metadata) : null)
     });
 }
 public static KitchenPC.Ingredients.IngredientMetadata ToIngredientMetadata(IngredientMetadata metadata)
 {
     return new KitchenPC.Ingredients.IngredientMetadata
      {
     HasMeat = metadata.HasMeat,
     CarbsPerUnit = metadata.CarbsPerUnit,
     HasRedMeat = metadata.HasRedMeat,
     SugarPerUnit = metadata.SugarPerUnit,
     HasPork = metadata.HasPork,
     FatPerUnit = metadata.FatPerUnit,
     SodiumPerUnit = metadata.SodiumPerUnit,
     CaloriesPerUnit = metadata.CaloriesPerUnit,
     Spicy = metadata.Spicy,
     Sweet = metadata.Sweet,
     HasGluten = metadata.HasGluten,
     HasAnimal = metadata.HasAnimal
      };
 }
 public static KitchenPC.Ingredients.IngredientMetadata ToIngredientMetadata(IngredientMetadata metadata)
 {
     return(new KitchenPC.Ingredients.IngredientMetadata
     {
         HasMeat = metadata.HasMeat,
         CarbsPerUnit = metadata.CarbsPerUnit,
         HasRedMeat = metadata.HasRedMeat,
         SugarPerUnit = metadata.SugarPerUnit,
         HasPork = metadata.HasPork,
         FatPerUnit = metadata.FatPerUnit,
         SodiumPerUnit = metadata.SodiumPerUnit,
         CaloriesPerUnit = metadata.CaloriesPerUnit,
         Spicy = metadata.Spicy,
         Sweet = metadata.Sweet,
         HasGluten = metadata.HasGluten,
         HasAnimal = metadata.HasAnimal
     });
 }