public User Execute(Guid userId) { return queryBuilder.IncludeAll() .SingleOrDefault(u => u.Id == userId); }
public User GetUser(Guid id) { var query = new UserByIdQuery(dbContext.Users); var user = query.Execute(id); if (user == null) { throw new EntityNotFoundException("User", id); } return user; }