public bool UserExists(string email, string password) { using (var db = new JudgeDbContext()) { return(db.Users.Any(u => u.Email == email && u.Password == password)); } }
static Launcher() { using (var db = new JudgeDbContext()) { db.Database.Migrate(); } }
static Launcher() { using (var context = new JudgeDbContext()) { context.Database.Migrate(); } AutoMapperConfiguration.Initialize(); }
private static void Main() { using (var db = new JudgeDbContext()) { db.Database.Migrate(); } AutoMapperConfiguration.Initialize(); MvcEngine.Run( new WebServer.WebServer(1337, DependencyControllerRouter.Get(), new ResourceRouter())); }
protected override void InitializeController() { base.InitializeController(); if (this.User.IsAuthenticated) { this.ViewModel["anonymousDisplay"] = "none"; this.ViewModel["userDisplay"] = "flex"; using (var db = new JudgeDbContext()) { this.Profile = db .Users .First(u => u.Email == this.User.Name); } } }
public bool Create(string email, string password, string name) { using (var db = new JudgeDbContext()) { if (db.Users.Any(u => u.Email == email)) { return(false); } var isAdmin = !db.Users.Any(); var user = new User { Email = email, Password = password, IsAdmin = isAdmin, FullName = name }; db.Add(user); db.SaveChanges(); return(true); } }
public UserService(JudgeDbContext db) { this.db = db; }
public UserService() { this.db = new JudgeDbContext(); }
public SubmissionService() { this.db = new JudgeDbContext(); }
public LoginModel GetById(int id) { using (var db = new JudgeDbContext()) { } }
public SubmissionService(JudgeDbContext context) { this.context = context; }
protected BaseController() { this.DbContext = new JudgeDbContext(); this.hashService = new HashService(new ConsoleLogger()); }
public UserService(JudgeDbContext context) { this.context = context; }
public ContestService() { this.db = new JudgeDbContext(); }
public ContestService(JudgeDbContext context) { this.context = context; }