Question

I have a task to extend my web application to provide users the ability to segment their own data (i.e choose their own fields and add their criteria using And/Or etc), so I'm creating something similar to a query builder tool but lighter. I'm not worrying about the front end for the moment, i am just trying to focus on how to do this in the back end.

My only thoughts so far are to store their "Segment" as an XML document (serialized in the DB) which contains all of their columns and criteria and how they map to the database, then when the segment is called, i have a mapping class which deserializes this xml document and maps the fields and builds a SQL query for this and then returns the query results. The problem i see with this is if the database setup changes (likely) then i have a serialized XML document which knows nothing about these changes.

Has anyone tacked a similar situation?

Was it helpful?

Solution

I had a similar problem and posted a question on here with what could be a potential solution to your own issue.

Dynamic linq query with multiple/unknown criteria

See how you get on with that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top