public EditModel(CodeCompete.Data.ApplicationDbContext context) { _context = context; Languages = context.ProgrammingLanguage .Select(l => new SelectListItem { Value = l.ProgrammingLanguageId.ToString(), Text = l.Name, }).ToList(); }
public CreateModel( CodeCompete.Data.ApplicationDbContext context, UserManager <ApplicationUser> userManager) { _context = context; _userManager = userManager; Languages = context.ProgrammingLanguage .Select(l => new SelectListItem { Value = l.ProgrammingLanguageId.ToString(), Text = l.Name, Selected = l.ProgrammingLanguageId == SelectedLanguage }).ToList(); }
public CreateModel(CodeCompete.Data.ApplicationDbContext context) { _context = context; Games = context.Game .Select(g => new SelectListItem { Value = g.GameId.ToString(), Text = g.Name, }).ToList(); Players = context.Player .Select(p => new SelectListItem { Value = p.PlayerId.ToString(), Text = p.Game.Name + " = " + p.Name, }).ToList(); }
public IndexModel(CodeCompete.Data.ApplicationDbContext context) { _context = context; }
public DetailsModel(CodeCompete.Data.ApplicationDbContext context) { _context = context; }