You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retrieving multiple entities of a different type in a single query is tricky in C#. Currently, you have to retrieve documents, then create multiple collections and fill them based on some conditions.
One of the ideas to improve this process is to expose ToListAsync<A, B, ...> overloads that accept predicates for each of the output types and returns a tuple.
var (mixedEntities, stringEntities) = await context.Query<KeysOnlyEntity>()
.AsDocuments()
.ToListAsync<MixedEntity, MediumStringFieldsEntity>(x => x["sk"].AsString().StartsWith("mixed#"), x => x["sk"].AsString().StartsWith("string#"));
The text was updated successfully, but these errors were encountered:
Predicate approach
Retrieving multiple entities of a different type in a single query is tricky in C#. Currently, you have to retrieve documents, then create multiple collections and fill them based on some conditions.
One of the ideas to improve this process is to expose
ToListAsync<A, B, ...>
overloads that accept predicates for each of the output types and returns a tuple.The text was updated successfully, but these errors were encountered: