Пример #1
0
        public List <UsuarioRegra> ListarUsuarioRegras()
        {
            List <UsuarioRegra> ret = null;

            try
            {
                ret = new List <UsuarioRegra>();
                using (IDataContextAsync context = new PCFTIDataContext())
                    using (IUnitOfWorkAsync unitOfWork = new UnitOfWork(context))
                    {
                        IRepositoryAsync <UsuarioRegra> usuarioregraRepository = new Repository <UsuarioRegra>(context, unitOfWork);
                        IUsuarioRegraService            usuarioregraService    = new UsuarioRegraService(usuarioregraRepository);
                        ret = usuarioregraService.ListarTodosOsUsuariosRegras().ToList <UsuarioRegra>();
                        unitOfWork.Dispose();
                    }
            }
            catch
            {
                ret = null;
            }
            return(ret);
        }