Skip to content

Instantly share code, notes, and snippets.

@Jtorrecilla
Created February 13, 2016 19:59
Show Gist options
  • Select an option

  • Save Jtorrecilla/7df3999011c3e589a88f to your computer and use it in GitHub Desktop.

Select an option

Save Jtorrecilla/7df3999011c3e589a88f to your computer and use it in GitHub Desktop.
static IEnumerable<string> GetColumns(Type type)
{
return type.GetProperties().Where(prop => !prop.PropertyType.IsGenericType &&
(prop.PropertyType.IsPrimitive || prop.PropertyType.Namespace.StartsWith("System"))
)
.Select(prop => prop.Name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment