c# - How can I best create filters based on Objects that are linked together? -
i have list of numbers linked each other:
000-1100-00 001-1100-00 000-1205-01 001-1205-01 001-1205-00
and forth..
i need data structure or way able apply filters on above.
for example, if second set of number has filtered on 1205, numbers come as
001-1205-01 000-1205-01 001-1205-00
a secondary filter might applied after first 1 , if filter on third set of number, 01, number returned be:
001-1205-01 000-1205-01
now, there might n number of sets it's not 3 sets. however, numbers have same amount of sets, if number of sets four, end looking like:
123-11-22-54
what options available me?
if add above columns sql database, how can searches without using dynamic sql create filters?
if not through sql, there alternative c# , data structures?
you don't need dynamic sql, need know looking for. if want 1205 in second position of 3, use:
where numbers '%-1205-%'
for third set use either:
where numbers '%-1205-%' , numbers '%-01'
or
where numbers '%-1205-01'
this constructing right parameter comparison, not dynamic sql.
in case, full answer question regular expressions. however, implementation of these quite database-specific , don't mention database using.
Comments
Post a Comment