Skip to content

Commit 8f03db6

Browse files
committed
Fix bugs in eventinfo
1 parent 03a0f72 commit 8f03db6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Enbiso.NLib.EventInfo/Models/EventRecordMapper.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ namespace Enbiso.NLib.EventInfo.Models;
77

88
public static class EventRecordMapper
99
{
10-
public static EventRecordProp Map(PropertyInfo property) =>
11-
new(property)
12-
{
13-
Props = property.PropertyType.GetProperties()
14-
.Where(p => ShouldExtract(p.PropertyType))
15-
.Select(p => new EventRecordProp(p)).ToList()
16-
};
10+
public static EventRecordProp Map(PropertyInfo property)
11+
{
12+
var prop = new EventRecordProp(property);
13+
if (!IsSimpleType(property.PropertyType))
14+
prop.Props = property.PropertyType.GetProperties()
15+
.Select(p => new EventRecordProp(p)).ToList();
16+
return prop;
17+
}
1718

1819
private static bool ShouldExtract(Type type)
1920
{

0 commit comments

Comments
 (0)