예제 #1
0
        public EditModel(CodeCompete.Data.ApplicationDbContext context)
        {
            _context = context;

            Languages = context.ProgrammingLanguage
                        .Select(l => new SelectListItem
            {
                Value = l.ProgrammingLanguageId.ToString(),
                Text  = l.Name,
            }).ToList();
        }
예제 #2
0
 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();
 }
예제 #3
0
        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();
        }
예제 #4
0
 public IndexModel(CodeCompete.Data.ApplicationDbContext context)
 {
     _context = context;
 }
예제 #5
0
 public DetailsModel(CodeCompete.Data.ApplicationDbContext context)
 {
     _context = context;
 }