public BaseResponse <VMUserResponse> Create([FromBody] VMCreateUserRequest vmRequest) { if (vmRequest == null) { return(BaseResponse <VMUserResponse> .SetError("Request body is empty")); } //try //{ var result = _userService.Create(vmRequest); var responseObject = VMUserListItem.ToResponse(result); var response = BaseResponse <VMUserResponse> .SetResponse(responseObject); return(response); //} //catch (Exception exc) //{ // return BaseResponse<VMUserResponse>.SetError(exc); //} }
public BaseResponse <VMUserResponse> Update([FromBody] VMUpdateUserRequest vmRequest) { if (vmRequest == null) { return(BaseResponse <VMUserResponse> .SetError("Request body is empty")); } try { var result = _userService.Update(vmRequest); var responseObject = VMUserListItem.ToResponse(result); var response = BaseResponse <VMUserResponse> .SetResponse(responseObject); return(response); } catch (Exception exc) { return(BaseResponse <VMUserResponse> .SetError(exc)); } }
public BaseResponse <VMUserResponse> Get(VMGetUserDetailsRequest vmRequest) { if (vmRequest == null) { return(BaseResponse <VMUserResponse> .SetError("Request body is empty")); } try { var result = _userService.Get(vmRequest); var responseObject = VMUserListItem.ToResponse(result); var response = BaseResponse <VMUserResponse> .SetResponse(responseObject); return(response); } catch (Exception exc) { return(BaseResponse <VMUserResponse> .SetError(exc)); } }