Definitions
IRP2Define*使
The second aspect of IRP enables the definition of new artifacts, which may compose over existing artifacts and introduce parameters. For cold artifacts, definitions can be performed using Define* methods:
Task DefineObservableAsync<T, R>(Uri uri, Expression<Func<T, IAsyncReactiveQbservable<R>>> observable);
Task DefineObserverAsync<T, R>(Uri uri, Expression<Func<T, IAsyncReactiveQbserver<R>>> observer);
...
For example, one could define a high-temperature operator as follows:
await ctx.DefineObservableAsync<double, WeatherInfo>(new Uri("eg://weather/hightemp"), t => ctx.Weather.Where(w => w.Temperature > t));
使
Once a definition is submitted to a service, the defined artifact can be referred to using the specified identifier.
IRPIRPAggregateMin使
IRP does not have any notion of built-in operators unlike traditional database systems where various operators such as filtering and projection are treated as primitives that are built-in. In the world of IRP, every operator ultimately gets defined. Some operators can be defined in terms of existing ones (e.g. Min in terms of Aggregate) while others are primitives that get defined using an expression that refers to a concrete implementation (backed by opaque code in an operator library hosted by the service).