I have an N-tiered application where I use the Specification template. Now I want to provide some ways to create specifications for client code. This should be a few predefined parameters, for example:
- Equally
- Greaterthan
- Contains
These objects (let me call them filters) should not contain any logic (methods), only the type and parameters of the data filter. And there has to be a natural way to turn them into specifications on the server. Here is an example of how it should look from the client side:
var serviceClient = new DataModuleService(); var equalFilter = new ContainsFilter<Book>("Title","Lord of the Rings"); var lordOfTheRingBooks = serviceClient.GetBooks(equalFilter);
There should also be filter types for all standard operations (for example, Equal, Greater, In, Between, StartsWith for a string, etc.) and ways to combine them with Boolean operators (and, or, not).
Are there some templates / standard methods for implementing such a thing?
UPD: the task is still frozen, and I began to think that there is a problem in the definition of the task.
vorou source share