Skip to content

Instantly share code, notes, and snippets.

@alexshyba
Created February 7, 2016 20:15
Show Gist options
  • Save alexshyba/645bb0cb6c004a9d1c18 to your computer and use it in GitHub Desktop.
Save alexshyba/645bb0cb6c004a9d1c18 to your computer and use it in GitHub Desktop.
GetProps
private dynamic GetProps()
{
dynamic props = new ExpandoObject();
var dataSourceItem = GetDataSourceItem();
foreach (Field field in dataSourceItem.Fields)
{
if (field.Name.StartsWith("__"))
{
continue;
}
((IDictionary<string, object>) props).Add(field.Name.ToLowerInvariant(), FieldRenderer.Render(dataSourceItem, field.Name));
}
return props;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment