예제 #1
0
파일: Launcher.cs 프로젝트: nayots/SoftUni
        static Launcher()
        {
            //PLEASE CHANGE THE CONNECTION STRING IF YOU ARE NOT USING SQL EXPRESS
            using (var db = new JudgeSystemDbContext())
            {
                //db.Database.EnsureDeleted();
                db.Database.EnsureCreated();
            }

            AutoMapperConfiguration.Initialize();
        }
예제 #2
0
        protected override void InitializeController()
        {
            base.InitializeController();

            if (this.User.IsAuthenticated)
            {
                this.ViewModel["anonymousDisplay"] = "none";
                this.ViewModel["userDisplay"]      = "flex";

                using (var db = new JudgeSystemDbContext())
                {
                    this.Profile = db
                                   .Users
                                   .First(u => u.Email == this.User.Name);

                    //if (this.Profile.IsAdmin)
                    //{
                    //    this.ViewModel["userDisplay"] = "none";
                    //    this.ViewModel["adminDisplay"] = "flex";
                    //}
                }
            }
        }
예제 #3
0
 public SubmissionService(JudgeSystemDbContext db)
 {
     this.db = db;
 }
예제 #4
0
 public UserService(JudgeSystemDbContext db)
 {
     this.db = db;
 }
예제 #5
0
 public ContestService(JudgeSystemDbContext db)
 {
     this.db = db;
 }