示例#1
0
        public async Task <IActionResult> CreateUser([FromBody] UserProfileRequiredDto profile)
        {
            /*
             *  {
             *  "userId": "1234",
             *  "logonName": "dktest1",
             *  "partnerId": "1",
             *  "firstName": "ABC",
             *  "lastName": "DEF",
             *  "city": "Miami",
             *  "state": "FL",
             *  "postalCode": "33101",
             *  "regMetro": "dee",
             *  "password": "******"
             *  }
             */
            try
            {
                var res = await _service.CreateOneUserAsync(profile);

                if (res.Result)
                {
                    return(Ok(res));
                }
                else
                {
                    return(BadRequest(res.ErrorMessage));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
        public Task <ApiResultModel <bool> > CreateOneUserAsync(UserProfileRequiredDto profile)
        {
            var request = new RestRequest("User/Create", Method.POST, DataFormat.Json);

            request.AddJsonBody(profile);

            return(_http.SendRequestAsync <ApiResultModel <bool> >(request));
        }
示例#3
0
 public Task <ApiResultModel <bool> > CreateOneUserAsync(UserProfileRequiredDto profile)
 {
     try
     {
         return(_repo.CreateOneUserAsync(profile));
     }
     catch (Exception e)
     {
         throw e;
     }
 }