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(); } }
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()); } }
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); }