params expression 3cfunc 3ct 2c object 3e 3e 5b 5d includeproperties

Solutions on MaxInterview for params expression 3cfunc 3ct 2c object 3e 3e 5b 5d includeproperties by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "params expression 3cfunc 3ct 2c object 3e 3e 5b 5d includeproperties"
Karissa
27 Oct 2017
1public TEntity GetById(Guid id, params Expression<Func<TEntity, object>>[] includeProperties)
2    {
3        if (id == Guid.Empty) return null;
4
5        var set = _unitOfWork.CreateSet<TEntity>();
6        foreach(var includeProperty in includeProperties)
7        {
8             set.Include(includeProperty);
9        }
10        return set.First(i => i.Id == id);
11    }
12