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

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