-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue #723 - Add Support ignore member when creating a constructor in DynamicTypeGenerator #754
base: development
Are you sure you want to change the base?
Conversation
Hello @andrerav . If the interface contains at least one property with a non-public setter, then all properties will be initialized via the constructor. I found a way to add this support, but maybe it was not intended that way? |
@@ -175,5 +186,27 @@ private static void CreateMethod(TypeBuilder builder, MethodInfo interfaceMethod | |||
|
|||
builder.DefineMethodOverride(classMethod, interfaceMethod); | |||
} | |||
|
|||
private static List<FieldBuilder> DropIgnorMemebers(List<FieldBuilder> fields) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly a typo: DropIgnoredMembers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes of course. This is not the final solution, you could say MVP :)
@@ -22,6 +22,16 @@ internal static class DynamicTypeGenerator | |||
private static readonly ConcurrentDictionary<Type, Type> _generated = new ConcurrentDictionary<Type, Type>(); | |||
private static int _generatedCounter; | |||
|
|||
private static IgnoreDictionary ignoreMembers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be nullable?
No description provided.