public IEnumerable <Recipe> GetRecipesByDifficulty(RecipeDifficulty difficulty)
 {
     using (ISession session = NHibernateSession.OpenSession())
     {
         return(session.Query <Recipe>().Where(r => r.Difficulty == difficulty).ToList());
     }
 }
Exemple #2
0
        void ReleaseDesignerOutlets()
        {
            if (RecipeCookTime != null)
            {
                RecipeCookTime.Dispose();
                RecipeCookTime = null;
            }

            if (RecipeDifficulty != null)
            {
                RecipeDifficulty.Dispose();
                RecipeDifficulty = null;
            }

            if (RecipeServes != null)
            {
                RecipeServes.Dispose();
                RecipeServes = null;
            }

            if (RecipeTitle != null)
            {
                RecipeTitle.Dispose();
                RecipeTitle = null;
            }

            if (ViewFrame != null)
            {
                ViewFrame.Dispose();
                ViewFrame = null;
            }
        }
 IEnumerable <Recipe> IRecipeRepository.GetRecipesByDifficulty(RecipeDifficulty difficulty)
 {
     return(recipes.FindAll(r => r.Difficulty == difficulty));
 }