Exemplo n.º 1
0
        public async Task <IActionResult> GetProfile(int id)
        {
            var dbResponse = await _db.GetProfile(id);

            if (dbResponse.ResponseCode == ReturnCodesConstant.R00)
            {
                var response = await _db.GenerateProfileDetails(dbResponse.ResponseData[0]);

                return(_responsesService.GetResponse(response));
            }
            else
            {
                return(_responsesService.GetResponse(dbResponse));
            }
        }
Exemplo n.º 2
0
        public async Task <ResponseModel <ProfileResponse> > GetAllProfiles()
        {
            ResponseModel <ProfileResponse> response = new ResponseModel <ProfileResponse>
            {
                ResponseData = new List <ProfileResponse>()
            };

            var dbResponse = await CallGetAll <Profile>();

            foreach (var item in dbResponse.ResponseData)
            {
                var profileResponse = await _db.GenerateProfileDetails(item);

                response.ResponseData.Add(profileResponse.ResponseData[0]);
            }
            response.ResponseCode    = dbResponse.ResponseCode;
            response.ResponseMessage = dbResponse.ResponseMessage;
            return(response);
        }