public override List<Recipe> GetRecipes()
 {
     using (var dbContext = new Data.Model())
     {
         return dbContext
                     .Recipes
                     .Select(r => new Recipe {Id = r.Id, Title = r.Name}).ToList();
     }
 }
Esempio n. 2
0
 public override List <Recipe> GetRecipes()
 {
     using (var dbContext = new Data.Model())
     {
         return(dbContext
                .Recipes
                .Select(r => new Recipe {
             Id = r.Id, Title = r.Name
         }).ToList());
     }
 }
Esempio n. 3
0
        private void CboModel_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.SelectedModel = null;
            var index = this.cboModel.SelectedIndex;

            if (index > -1)
            {
                this.SelectedModel = this.ViewModel.Models[index] as Data.Model;
            }

            this.ViewModel.GetCars(this.SelectedMake?.Id ?? 0, this.SelectedModel?.Id ?? 0);
        }