Skip to content

Commit

Permalink
No longer sort properties and fields by name
Browse files Browse the repository at this point in the history
Fixes issue #1
  • Loading branch information
jpierson committed Feb 28, 2017
1 parent ff36a48 commit 9109d23
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ToMarkdownTable/LinqMarkdownTableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public static string ToMarkdownTable<T>(this IEnumerable<T> source)

var gettables = Enumerable.Union(
properties.Select(p => new { p.Name, GetValue = (Func<object, object>)p.GetValue, Type = p.PropertyType }),
fields.Select(p => new { p.Name, GetValue = (Func<object, object>)p.GetValue, Type = p.FieldType }))
.OrderBy(g => g.Name);
fields.Select(p => new { p.Name, GetValue = (Func<object, object>)p.GetValue, Type = p.FieldType }));

var maxColumnValues = source
.Select(x => gettables.Select(p => p.GetValue(x)?.ToString()?.Length ?? 0))
Expand Down

0 comments on commit 9109d23

Please sign in to comment.