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
that version 2 has.
What does version 3 have that is equivalent to these?
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
that version 2 has.
What does version 3 have that is equivalent to these?
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.
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;