Пример #1
0
        private async Task _validate(ChangedChallenge model)
        {
            if ((await Exists(model.Id)).Equals(false))
            {
                throw new ResourceNotFound();
            }

            await Task.CompletedTask;
        }
Пример #2
0
        public async Task <Challenge> StopGamespace([FromBody] ChangedChallenge model)
        {
            AuthorizeAny(
                () => Actor.IsDirector,
                () => ChallengeService.UserIsTeamPlayer(model.Id, Actor.Id).Result
                );

            await Validate(new Entity { Id = model.Id });

            var result = await ChallengeService.StopGamespace(model.Id, Actor.Id);

            await Hub.Clients.Group(result.TeamId).ChallengeEvent(
                new HubEvent <Challenge>(result, EventAction.Updated)
                );

            return(result);
        }
Пример #3
0
 public Task Update([FromBody] ChangedChallenge model)
 {
     // await ChallengeService.Update(model);
     return(Task.CompletedTask);
 }