Method As
| MongoDB CSharp Driver API Reference (original) (raw)
Namespace
Assembly
MongoDB.Driver.dll
As<TSource, TResult>(IQueryable, IBsonSerializer)
Allows the results to be interpreted as a different type. It is up to the caller to determine that the new result type is compatible with the actual results.
public static IQueryable<TResult> As<TSource, TResult>(this IQueryable<TSource> source, IBsonSerializer<TResult> resultSerializer = null)
Parameters
source
IQueryable
A sequence of values.
resultSerializer
IBsonSerializer
The new serializer (optional, will be looked up if null).
Returns
A new IQueryable with a new result type.
Type Parameters
TSource
The type of the elements of source
.
TResult
The new result type for the results.