RxDave / Qactive

Reactive queryable observable framework.
Apache License 2.0
157 stars 20 forks source link

Anonymous Projection #8

Closed RxDave closed 8 years ago

RxDave commented 8 years ago

Edit: The original description was overcomplicated. Simply provide support for projecting to anonymous types from within a client's query. No options or protocol negotiation is required.

Consider supporting projection of anonymous types in the IQbservable by allowing clients to opt-in (via another option flag?) to it and specify a concrete type for T with matching properties. The client proxy would automatically map an instance of the anonymous type into a new instance of T.

To ensure that mismatches cause errors as soon as possible, if the server proxy detects that an anonymous type is being projected, then as part of the negotiation protocol it serializes a single empty instance of the type and transmits it to the client. The client then validates T against the anonymous type's definition during the client-side negotiation process and fails immediately if there is a mismatch.