Created
February 7, 2016 20:15
-
-
Save alexshyba/645bb0cb6c004a9d1c18 to your computer and use it in GitHub Desktop.
GetProps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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