private async Task _validate(ChangedChallenge model) { if ((await Exists(model.Id)).Equals(false)) { throw new ResourceNotFound(); } await Task.CompletedTask; }
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); }
public Task Update([FromBody] ChangedChallenge model) { // await ChallengeService.Update(model); return(Task.CompletedTask); }