Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Modifying DataSourceResult in C#
public ActionResult Read([DataSourceRequest]DataSourceRequest, int item_id){
DataSourceResult audits = logs.ToDataSourceResult(request, audit => new AuditDTO{
id = audit.id
});
System.Collections.IEnumerable items = audits.Data;
if (items != null){
IEnumerator sEnum = items.GetEnumerator();
while (sEnum.MoveNext()){
AuditDTO key = (AuditDTO)sEnum.Current;
if (key != null){
key.field_name = "blah";
key.old_value = "blah";
key.new_value = "blah";
}
}
}
return Json(audits);
}

gramx commented Apr 5, 2016

Thank you, I found this helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment