public static GetChanges ( int id, string table, string property ) : List |
||
id | int | The id. |
table | string | The table. |
property | string | The property. |
return | List |
public static List<FieldChange> GetChanges(int id, string table, string property)
{
string key = id.ToString();
CTSContext db = new CTSContext();
var changes = (from audit in db.Audits
where audit.TableName == table && audit.PrimaryKey == key && audit.NewValue.Contains(property)
orderby audit.DateTime descending
select audit);
List<FieldChange> filedsList = new List<FieldChange>();
foreach (Audit a in changes)
{
filedsList.Add(new FieldChange(a,property));
}
return filedsList;
}