internal static IQueryable <T> Distinct <T>(this IQueryable <T> queryable) { if (queryable is IMongoQueryable <T> mongoQueryable) { return(MongoQueryable.Distinct(mongoQueryable)); } return(Queryable.Distinct(queryable)); }