-
Notifications
You must be signed in to change notification settings - Fork 84
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
Allow support for nested StrongleTypeIds #153
Comments
Yes, this is supported in the latest version 🙂
|
Hi there, it appears I am using the latest version. When I add the handle, I get 2 errors. This is the relevant generated section: And the two errors:
I am probably doing something obviously wrong. Thanks for you assistance! :) Oh, and the original source: |
Ah, add |
Yeah unfortunately, that's not valid c# to use that attribute, because the attribute is defined as a nested type, which means the full name has a generic type parameter in it, and you can't use that. Your only options are to remove the attribute or to not nest it in the generic unfortunately |
Ok, understood! Do I need to remove it from the generated file, or is there an option I can use to to have it removed as part of the source generation? Have a good day :) |
Unfortunately you will need to use a custom template to remove the attribute from the generated code. You can read about how to use the codefix provider to create a custom template in the README and you can read more about what you can do with them here. Hope that helps! |
Really like this library and have began integrating it in to my engine. However, there's a part of my project I cannot use this library easily, and that's where the strongly typed Id could be used as a nested class.
Essentially, what i want to do is this:
Is this sort of thing possible? If I need to make
Factory<T>
partial also, I'd not be against it.The text was updated successfully, but these errors were encountered: