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