private static string MODULE = "WebAPI.SawController.{0}"; // Pass method name. public Response <UserDto> Get(long UserId) { Response <UserDto> response = new Response <UserDto>(); try { AssetContext assetContext = new AssetContext(); var User = assetContext.GetUserById(UserId); if (User != null) { response.Item = User; response.Code = OperationCode.ResponseCode.SUCCESS; response.MessageList.Add(MessageResource.GetInstance().GetText("SawDAL_GetSuccess", MESSAGE_RESOURCE)); } else { response.Code = OperationCode.ResponseCode.NO_FOUND; response.NotFoundList.Add(MessageResource.GetInstance().GetText("SawDAL_GetNotExisting", MESSAGE_RESOURCE)); } } catch (Exception ex) { response.Item = null; response.Code = OperationCode.ResponseCode.ERROR; response.ErrorList.Add(MessageResource.GetInstance().GetText("SawIL_GetInvalid", MESSAGE_RESOURCE)); } return(response); }