views:

15

answers:

1

Hi,

I am using SubSonic 3.0.0.4 with the ActiveRecord T4 Templates. I am hooking into OnSaving and getting a list of dirty columns that are about to be saved. What I cannot figure out is how to get each of the dirty columns values. Can someone assist?

TIA - Mike

A: 

I didnt found any direct way to get the dirty column value.

But you can try reflection to get it.

Try something like:

// item is the entity
List<IColumn> lst = item.GetDirtyColumns();
var res = from p in item.GetType().GetProperties()
                          where p.Name == lst[0].Name
                          select p.GetValue(item, null);
Krunal