Exemplo n.º 1
0
        public async Task <List <Entities.Problem> > GetProblems(string token)
        {
            if (string.IsNullOrEmpty(token))
            {
                throw new System.Exception("An authorization token required.");
            }
            token = token.Replace("Basic ", "");
            List <Entities.Problem> list = null;

            var userData = await this.userRepo.GetByToken(token);

            if (userData != null)
            {
                list = await problemRepo.GetByUser(userData?.Username);
            }
            return(list);
        }