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); }
public List <Modulo> GetModulosByUserId(ModulosByUserIdSpec spec) { return(this.Query(spec)); }