Skip to content
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

[Bug] DynamicClassFactory not caching generated types #84

Closed
HunterMcEwan opened this issue May 26, 2017 · 3 comments
Closed

[Bug] DynamicClassFactory not caching generated types #84

HunterMcEwan opened this issue May 26, 2017 · 3 comments
Assignees
Labels

Comments

@HunterMcEwan
Copy link

Inside DynamicClassFactory.CreateType it appears to be attempting to cache previously generated types with the same property names. However it is using different strategies for creating the dictionary key when doing the lookups:

string fullName = string.Join("|", names.Select(Escape).ToArray());

if (!GeneratedTypes.TryGetValue(fullName, out type))

and then later when doing the updates:

type = GeneratedTypes.GetOrAdd(fullName + "|_" + (createParameterCtor ? "1" : "0"), type);

@StefH StefH self-assigned this Jun 1, 2017
@StefH StefH added the bug label Jun 1, 2017
@StefH
Copy link
Collaborator

StefH commented Jun 1, 2017

I will take a look, thanks for reporting.

StefH added a commit that referenced this issue Jun 1, 2017
@StefH StefH changed the title DynamicClassFactory not caching generated types [Bug] DynamicClassFactory not caching generated types Jun 1, 2017
@StefH StefH closed this as completed Jun 1, 2017
@StefH
Copy link
Collaborator

StefH commented Jun 1, 2017

Code is fixed, NuGet version1.0.7.3 uploaded.

@HunterMcEwan
Copy link
Author

Thanks for the quick response/fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants