예제 #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)
     });
 }
예제 #2
0
 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
      };
 }
예제 #3
0
 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
     });
 }