I have been thinking of something along these lines ...
on one hand you could have "simple crtieria" like CSLA passes most of the time
x=1,y=2,z="foo" and in that case you could just save an xml snip with in the database and serialize / de-serialize that.
or you could get more involved and have a "complex criteria" class that might have something like:
Name - string
Operator - Enum list of common op's like ( =, >, < ,!, Like, IN)
Value - string
and then make the Criteria class be a List Of CriteriaExpressions
you could then store them in sql as xml also....
then you could get even more indepth with things like AND / OR and () nesting
but then you are really getting into a lot of work....
I think 90% would be coved with x>21 AND y in (21,34,56) AND Date < '1/2/3'
assume all expersions and "ANDED" and you could pass a string to SQL to have a proc do a dynamic select
exec 'Select ...... WHERE ' + @params
just watch out for SQL injections!!!!
Copyright (c) Marimer LLC