public async Task <IActionResult> UpdateUserProfileStatusAll(Boolean Status) { try { if (!ModelState.IsValid) { return(Ok(new OperationResponse { HasSucceeded = false, IsDomainValidationErrors = true, StatusCode = ((int)ResponseStatus.BadRequest).ToString(), Message = string.Join("; ", ModelState.Values .SelectMany(x => x.Errors) .Select(x => x.ErrorMessage)) })); } ProfileDataAccess _profileAccess = new ProfileDataAccess(_iconfiguration); DatabaseResponse response = await _profileAccess.UpdateUserProfileStatusAll(Status); if (response.ResponseCode == (int)DbReturnValue.UpdateSuccess) { return(Ok(new OperationResponse { HasSucceeded = true, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.UpdateSuccess), ReturnedObject = response.Results })); } else { Log.Error(EnumExtensions.GetDescription(DbReturnValue.UpdationFailed)); return(Ok(new OperationResponse { HasSucceeded = false, IsDomainValidationErrors = false, Message = EnumExtensions.GetDescription(DbReturnValue.UpdationFailed), ReturnedObject = response.Results })); } } catch (Exception ex) { Log.Error(new ExceptionHelper().GetLogString(ex, ErrorLevel.Critical)); return(Ok(new OperationResponse { HasSucceeded = false, Message = StatusMessages.ServerError, StatusCode = ((int)ResponseStatus.ServerError).ToString(), IsDomainValidationErrors = false })); } }