示例#1
0
        public GetUserResponse GetUserById(GetUserRequest request)
        {
            GetUserResponse response = new GetUserResponse();
            SecurityBusinessComponent bc = DependencyInjectionHelper.GetSecurityBusinessComponent();

            User user = bc.GetUserById(request.Id);
            response.User = SecurityAdapter.UserToDTO(user);

            return response;
        }
示例#2
0
 public UserDTO GetUserById(int id)
 {
     try
     {
         GetUserRequest request = new GetUserRequest();
         request.Id = id;
         GetUserResponse response = Service.GetUserById(request);
         return response.User;
     }
     catch (Exception ex)
     {
         if (ExceptionPolicy.HandleException(ex, "PL Policy")) throw;
         return new UserDTO();
     }
 }