My problem is this. Our clients create different fields they want to
collect and we allow them build dynamic filters, reports etc...
We run some TSQL to actually create the column and all works very well. We
are now adding a lot more functionality to our filters and could really
benefit from using the LINQ to SQL.
I have experimented with the Dynamic Linq
(http://weblogs.asp.net/scottgu/archi...y-library.aspx)
and it is exactly what we need to let them create their own filters and
such. But when I try to filter on a column that does not exist in the Data
Context I get an error, which is understandable.
They have one table that they can add columns to, so I am going to attempt
to dynamically add the new properties and attributes before running the LINQ
query.
For example, if a client adds a new column called Age of type Int, I want to
add a new property to the object.
So it looks like I need to add a property that looks something like:
[Column(Storage="Age", DbType="Int NOT NULL")]
public int Age { get; set;}
I've been reading different reflection techniques and examples for the past
two days and seems like I'm going around in circles..
Does anyone have any suggestions on how I might accomplish this? Anything
to point me in the right direction would be greatly appreciated.