예제 #1
0
        public async Task <TEntity> GetByIdAsync(int id, params Expression <Func <TEntity, object> >[] includeProperties)
        {
            GenericService <TEntity> service = new GenericService <TEntity>(CreateContext());
            var e = await service.GetByCoditionIncludes(GetSpecificationForGetById(id), includeProperties).AsNoTracking().SingleOrDefaultAsync();

            service.Dispose();
            return(e);
        }
예제 #2
0
 protected IQueryable <TEntity> GetForRead(out GenericService <TEntity> service, ISpecification <TEntity> filterCondition = null, params Expression <Func <TEntity, object> >[] includeProperties)
 {
     service = new GenericService <TEntity>(CreateContext());
     return(service.GetByCoditionIncludes(filterCondition, includeProperties).AsNoTracking());
 }