-
Notifications
You must be signed in to change notification settings - Fork 48
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
Get model property alias without UmbracoContext #223
base: v8/dev
Are you sure you want to change the base?
Get model property alias without UmbracoContext #223
Conversation
Hey, thanks for the PR! If I understand correctly, it will allow me to do:
Is that it? As part of #215 the plan was to generate a metadata class that would allow you to do:
And here, |
…ation to PublishedModelUtility
Your example is correct, but having all the aliasses as constants looks even more promising and aligns more with how Umbraco stores the default aliasses (for conventions, etc.) 👍 If #215 is implemented, this would become obsolete, so maybe we shouldn't generate the additional method for now... I've cleaned up the already public methods on With this PR, you'll be able to get the property alias without an PublishedModelUtility.GetModelPropertyTypeAlias<Project>(p => p.Products); |
👍 |
+1 for getting this in as soon as poss, as I was looking at submitting a PR for exactly this functionality myself, but glad it's been considered and a fix been written. |
It would be great if this gets merged into the latest version, especially if #215 isn't yet implemented (but even if it is, this PR contains some bugfixes for existing code)... |
This PR adds a new method to the generated models, so the property alias can be retrieved without requiring an
UmbracoContext
and will also be faster (because it does less).