Пример #1
0
        public async Task <IActionResult> Index(
            SubmitFlagViewModel model,
            [FromServices] FlagRepository _flagRepository,
            [FromServices] ScoringRepository _scoreRepository
            )
        {
            if (ModelState.IsValid)
            {
                var quest = await _questRepository.GetQuest(model.QuestId);

                if (quest != null)
                {
                    var flag = await _flagRepository.GetFlag(quest);

                    if (CryptographicOperations.FixedTimeEquals(Encoding.Unicode.GetBytes(flag), Encoding.Unicode.GetBytes(model.Flag)))
                    {
                        await _scoreRepository.AddTeamScore(User.Identity.Name !, quest.Id);

                        return(RedirectToAction("Index", "Scoreboard"));
                    }
                }
            }
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public UnitOfWork(YapGetirComDbContext db)
        {
            _db = db;

            CampaignRepository           = new CampaignRepository(_db);
            CategoryRepository           = new CategoryRepository(_db);
            CategoryTypeRepository       = new CategoryTypeRepository(_db);
            CommentRepository            = new CommentRepository(_db);
            CookRepository               = new CookRepository(_db);
            MessageRepository            = new MessageRepository(_db);
            OrderRepository              = new OrderRepository(_db);
            PaymentRepository            = new PaymentRepository(_db);
            ProductOrderDetailRepository = new ProductOrderDetailRepository(_db);
            ProductOrderRepository       = new ProductOrderRepository(_db);
            ProductRepository            = new ProductRepository(_db);
            RecipeRepository             = new RecipeRepository(_db);
            RestaurantRepository         = new RestaurantRepository(_db);
            ScoringRepository            = new ScoringRepository(_db);
            SharedRepository             = new SharedRepository(_db);
            StockRepository              = new StockRepository(_db);
            SupplierRepository           = new SupplierRepository(_db);
            UserRepository               = new UserRepository(_db);
            UserTypeRepository           = new UserTypeRepository(_db);
        }
Пример #3
0
 public ScoreboardController(ScoringRepository scoringRepository, QuestRepository questRepository)
 {
     _scoringRepository = scoringRepository;
     _questRepository   = questRepository;
 }
Пример #4
0
 public ByPassController(ScoringRepository scoringRepository)
 {
     _scoringRepository = scoringRepository;
 }