示例#1
0
 private static List<HopViewModel> GetHopsUsed(Recipe recipeModel)
 {
     return
         recipeModel.RecipeHops.Select(
             r =>
             new HopViewModel
                 {
                     Alpha = r.Hop.Alpha,
                     AmountKg = r.Amount,
                     Beta = r.Hop.Beta,
                     Name = r.Hop_Name,
                     UsedDuring = r.HopUses_Name,
                     Form = r.Hop.HopForm_Name,
                     PercentCaryophyllene = r.Hop.Caryophyllene,
                     PercentCohumulone = r.Hop.Cohumulone,
                     PercentHumulene = r.Hop.Humulene,
                     PercentMyrcene = r.Hop.Myrcene,
                     Stability = r.Hop.HSI,
                     Type = r.Hop.HopType_Name,
                     UsageTimeMin = TimeSpan.FromMinutes(r.Time)
                 }).ToList();
 }
示例#2
0
 private static List<FermentableViewModel> GetFermentablesUsed(Recipe recipeModel)
 {
     return
         recipeModel.RecipeFermentables.Select(
             f =>
             new FermentableViewModel
                 {
                     IsAddedAfterBoiling = f.AddAfterBoil,
                     Amount = f.Amount,
                     Color = f.Fermentable.Color,
                     DiastaticPower = f.Fermentable.DiastaticPower,
                     CourseGrainYield = f.Fermentable.Yield + f.Fermentable.CoarseFineDiff,
                     Name = f.Fermentable_Name,
                     Yield = f.Fermentable.Yield
                 }).ToList();
 }