I am converting a project from Subsonic Version 2.2 to 3.0.0.3 and have been unable to find the equivalent functionality of SetColumnValue and GetColumnValue in version 2. Any help appreciated. LK
views:
109answers:
2
+1
A:
There is currently no equivalent functionality. The 3.x generated classes use backing fields for properties instead having an underlying data store. Right now, you would need to use reflection.
John Sheehan
2009-07-28 14:56:27
+1
A:
I think you need something like this:
Person p = new Person(x => x.ID == 3);
// replacement for SetColumnValue
p.GetType().GetProperty("FirstName").SetValue(p, "Stinky", null);
// replacement for GetColumnValue
string s = p.GetType().GetProperty("FirstName").GetValue(p, null) as String;
jcomet
2009-07-30 18:03:17