Table of Contents

Class MixedExtensions

Namespace
DynaSharp
Assembly
DynaSharp.dll

Turns a read of a table without a schema into a mixed read. These are extension methods so that the rest does not compile: a read of Table<Order> has filtered on its discriminator already, so no other type could reach it.

public static class MixedExtensions
Inheritance
MixedExtensions
Inherited Members

Methods

Of<T1, T2>(QueryCommand<Item>)

Reads the partition as several types: await foreach (var item in shop.Query(pk).Of<Customer, Order>().ItemsAsync(ct)). See MixedQueryCommand<TMixed>.

public static MixedQueryCommand<Mixed<T1, T2>> Of<T1, T2>(this QueryCommand<Item> command) where T1 : IDynamoDbDiscriminated<T1> where T2 : IDynamoDbDiscriminated<T2>

Parameters

command QueryCommand<Item>

The query.

Returns

MixedQueryCommand<Mixed<T1, T2>>

The command, which replaces this one.

Type Parameters

T1

The first type. A type without a discriminator is a compile error.

T2

The second type.

Remarks

It works on an index of a table without a schema too, and clauses can come before and after this call. The items come in the order of the sort key, as in any query, whatever their type: under CUSTOMER#alice, ORDER#... sorts before PROFILE, so Descending() gives the profile first. The order of the type arguments says nothing about the order of the items.

Exceptions

ArgumentException

Two types have one discriminator, or keep it in different attributes, which DynamoDB could not filter on with one IN.

InvalidOperationException

The command was already sent, extended or rendered.

Of<T1, T2>(ScanCommand<Item>)

Scans the table or index as several types: shop.Scan().Of<Customer, Order>(). Clauses can come before and after this call. See MixedScanCommand<TMixed>.

public static MixedScanCommand<Mixed<T1, T2>> Of<T1, T2>(this ScanCommand<Item> command) where T1 : IDynamoDbDiscriminated<T1> where T2 : IDynamoDbDiscriminated<T2>

Parameters

command ScanCommand<Item>

The scan.

Returns

MixedScanCommand<Mixed<T1, T2>>

The command, which replaces this one.

Type Parameters

T1

The first type. A type without a discriminator is a compile error.

T2

The second type.

Exceptions

ArgumentException

Two types have one discriminator, or keep it in different attributes, which DynamoDB could not filter on with one IN.

InvalidOperationException

The command was already sent, extended or rendered.

Of<T1, T2, T3>(QueryCommand<Item>)

Reads the partition as several types: await foreach (var item in shop.Query(pk).Of<Customer, Order>().ItemsAsync(ct)). See MixedQueryCommand<TMixed>.

public static MixedQueryCommand<Mixed<T1, T2, T3>> Of<T1, T2, T3>(this QueryCommand<Item> command) where T1 : IDynamoDbDiscriminated<T1> where T2 : IDynamoDbDiscriminated<T2> where T3 : IDynamoDbDiscriminated<T3>

Parameters

command QueryCommand<Item>

The query.

Returns

MixedQueryCommand<Mixed<T1, T2, T3>>

The command, which replaces this one.

Type Parameters

T1

The first type. A type without a discriminator is a compile error.

T2

The second type.

T3

The third type.

Remarks

It works on an index of a table without a schema too, and clauses can come before and after this call. The items come in the order of the sort key, as in any query, whatever their type: under CUSTOMER#alice, ORDER#... sorts before PROFILE, so Descending() gives the profile first. The order of the type arguments says nothing about the order of the items.

Exceptions

ArgumentException

Two types have one discriminator, or keep it in different attributes, which DynamoDB could not filter on with one IN.

InvalidOperationException

The command was already sent, extended or rendered.

Of<T1, T2, T3>(ScanCommand<Item>)

Scans the table or index as several types: shop.Scan().Of<Customer, Order>(). Clauses can come before and after this call. See MixedScanCommand<TMixed>.

public static MixedScanCommand<Mixed<T1, T2, T3>> Of<T1, T2, T3>(this ScanCommand<Item> command) where T1 : IDynamoDbDiscriminated<T1> where T2 : IDynamoDbDiscriminated<T2> where T3 : IDynamoDbDiscriminated<T3>

Parameters

command ScanCommand<Item>

The scan.

Returns

MixedScanCommand<Mixed<T1, T2, T3>>

The command, which replaces this one.

Type Parameters

T1

The first type. A type without a discriminator is a compile error.

T2

The second type.

T3

The third type.

Exceptions

ArgumentException

Two types have one discriminator, or keep it in different attributes, which DynamoDB could not filter on with one IN.

InvalidOperationException

The command was already sent, extended or rendered.

Of<T1, T2, T3, T4>(QueryCommand<Item>)

Reads the partition as several types: await foreach (var item in shop.Query(pk).Of<Customer, Order>().ItemsAsync(ct)). See MixedQueryCommand<TMixed>.

public static MixedQueryCommand<Mixed<T1, T2, T3, T4>> Of<T1, T2, T3, T4>(this QueryCommand<Item> command) where T1 : IDynamoDbDiscriminated<T1> where T2 : IDynamoDbDiscriminated<T2> where T3 : IDynamoDbDiscriminated<T3> where T4 : IDynamoDbDiscriminated<T4>

Parameters

command QueryCommand<Item>

The query.

Returns

MixedQueryCommand<Mixed<T1, T2, T3, T4>>

The command, which replaces this one.

Type Parameters

T1

The first type. A type without a discriminator is a compile error.

T2

The second type.

T3

The third type.

T4

The fourth type.

Remarks

It works on an index of a table without a schema too, and clauses can come before and after this call. The items come in the order of the sort key, as in any query, whatever their type: under CUSTOMER#alice, ORDER#... sorts before PROFILE, so Descending() gives the profile first. The order of the type arguments says nothing about the order of the items.

Exceptions

ArgumentException

Two types have one discriminator, or keep it in different attributes, which DynamoDB could not filter on with one IN.

InvalidOperationException

The command was already sent, extended or rendered.

Of<T1, T2, T3, T4>(ScanCommand<Item>)

Scans the table or index as several types: shop.Scan().Of<Customer, Order>(). Clauses can come before and after this call. See MixedScanCommand<TMixed>.

public static MixedScanCommand<Mixed<T1, T2, T3, T4>> Of<T1, T2, T3, T4>(this ScanCommand<Item> command) where T1 : IDynamoDbDiscriminated<T1> where T2 : IDynamoDbDiscriminated<T2> where T3 : IDynamoDbDiscriminated<T3> where T4 : IDynamoDbDiscriminated<T4>

Parameters

command ScanCommand<Item>

The scan.

Returns

MixedScanCommand<Mixed<T1, T2, T3, T4>>

The command, which replaces this one.

Type Parameters

T1

The first type. A type without a discriminator is a compile error.

T2

The second type.

T3

The third type.

T4

The fourth type.

Exceptions

ArgumentException

Two types have one discriminator, or keep it in different attributes, which DynamoDB could not filter on with one IN.

InvalidOperationException

The command was already sent, extended or rendered.