public virtual GetModulesByUserIdResponse GetModulesByUserId(GetModulesByUserIdRequest request) { var response = new GetModulesByUserIdResponse(); try { // Raise Initialization Event var initialization = GetModulesByUserIdInitialization; if (initialization != null) { initialization(request, response); } // Raise Execute Event var execute = GetModulesByUserIdExecute; if (execute != null) { response = execute(request); } // Raise Complete Event var complete = GetModulesByUserIdComplete; if (complete != null) { complete(request, response); } } catch (Exception exception) { // Raise Error Event var error = GetModulesByUserIdError; if (error != null) { error(request, response, exception); } } return(response); }
public override GetModulesByUserIdResponse OnGetModulesByUserIdExecute(GetModulesByUserIdRequest request) { GetModulesByUserIdResponse response = new GetModulesByUserIdResponse(); try { var parentsSpec = new ModulosParentsSpec(); var parentsModules = _moduloRepository.Query(parentsSpec); var spec = new ModulosByUserIdSpec(request.Id); var modulesByUser = _moduloRepository.GetModulosByUserId(spec); response.Modulos = _moduloFactory.CreateListModules(parentsModules, modulesByUser); } catch (Exception ex) { response.Exception = ex; } return(response); }