Ejemplo n.º 1
0
        public static MaterialCategoriesRepository GetMaterialCategoriesRepository(IUnitOfWork unitOfWork)
        {
            var repository = new MaterialCategoriesRepository();

            repository.UnitOfWork = unitOfWork;
            return(repository);
        }
Ejemplo n.º 2
0
        public Task <ExecuteResultEntity <ICollection <MaterialCategories> > > GetMaterialCategoriesListAsync()
        {
            try
            {
                MaterialCategoriesRepository repo = RepositoryHelper.GetMaterialCategoriesRepository(database);

                var result = from q in repo.All()
                             select q;

                return(Task.FromResult(ExecuteResultEntity <ICollection <MaterialCategories> > .CreateResultEntity(
                                           new Collection <MaterialCategories>(result.ToList()))));
            }
            catch (Exception ex)
            {
                return(Task.FromResult(ExecuteResultEntity <ICollection <MaterialCategories> > .CreateErrorResultEntity(ex)));
            }
        }