Skip to content

Instantly share code, notes, and snippets.

@janoulle
Last active April 5, 2016 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janoulle/895074ab0214eec116ef to your computer and use it in GitHub Desktop.
Save janoulle/895074ab0214eec116ef to your computer and use it in GitHub Desktop.
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
Copy link

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