Beispiel #1
0
        public async Task <IActionResult> AddAdminUsers(AdminUsersDto adm, CancellationToken cancellationToken)
        {
            try
            {
                int result = await _adminService.AddAdminUsers(adm, cancellationToken).ConfigureAwait(false);

                if (result == 0)
                {
                    return(BadRequest("User already exist"));
                }
                else
                {
                    return(Ok("Admin User Added Successfully"));
                }
            }
            catch (Exception ex)
            {
                await _errorlogService.InsertError(Request.GetDisplayUrl(), ControllerContext.ActionDescriptor.ActionName.ToString(), ex.Message, ex.ToString()).ConfigureAwait(false);

                return(StatusCode(500, ex.InnerException));
            }
        }