public UserModel GetById(Guid id, bool includeInActive = false, bool includeNonPublic = false) { using (var uow = new DbUnitOfWork(_context)) { var repositories = new IRepository[] { _repository }; uow.Enlist(repositories); uow.InitTransaction(); return(Filter(Populate(_repository.GetById(id), includeInActive, includeNonPublic), includeInActive, includeNonPublic)); } }
public IEnumerable <UserModel> GetAll(bool includeInActive = false, bool includeNonPublic = false) { using (var uow = new DbUnitOfWork(_context)) { var repositories = new IRepository[] { _repository }; uow.Enlist(repositories); uow.InitTransaction(); return(Filter(_repository.GetAll().Select(o => Populate(o, includeInActive, includeNonPublic)), includeInActive, includeNonPublic)); } }