public async Task <UserActiveLeague> GetActiveLeague() { var userId = _securityContext.User.Id; var item = await _competitionQueryProcessor.GetUserActiveLeague(userId); if (item == null) { throw new NotFoundException("User don't have league for this season !"); } var model = _mapper.Map <UserActiveLeague>(item); return(model); }
long IValueResolver <User, object, long> .Resolve(User source, object destination, long destMember, ResolutionContext context) { var x = Task.Run(async() => await _competitionQueryProcessor.GetUserActiveLeague(source.Id)) .Result; if (x == null) { return(0); } return(x.Id); }