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); }
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()); }