I don’t have insider knowledge about this, but that’s why I think the method exists based on translation and implementation in the built-in QueryBuilder .
All operations in QueryBuilder represent a data source using QuerySource<'R, 'Q> , where 'R is the element type and 'Q is the data source type is either IEnumerable or IQueryable .
The fact that there is only one data type means that it does not need to define separate overloads for IQueryable and IEnumerable - which would otherwise be necessary, because the Run method in the end should do different things for IEnumerable and IQueryable .
Thus, the Source method allows you to convert any input data that a query can work with into some “internal representation” of the data source. At the opposite end, the Run method turns data from this internal representation into a regular value. (In the case of QueryBuilder you will never see the QuerySource type in your own code.)
source share