Пример #1
0
        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);
        }
Пример #2
0
 public List <Modulo> GetModulosByUserId(ModulosByUserIdSpec spec)
 {
     return(this.Query(spec));
 }