-
Notifications
You must be signed in to change notification settings - Fork 49
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
Provide option for generated code to use Language Fallback #235
Comments
IIRC there is a plan within MB (and also within Embedded MB) to generate extension methods for each property. This already occurs for things like we came up with this concept with @zpqrtbnk a while back but didn't get around to it. I still think this is a good approach and makes everything consistent. thoughts? |
I created a PR, but it generated a new issue (#236). Sorry, I'm new to the whole PR thing and may have missed how to do the correct flow. My first thought in regards to your feedback: the extension methods are good in itself, as they open up many possibilities, but developers would still have to "do something" for each property, which is exactly what I'm trying to avoid here. Instead of using I would like other developers and those who only make views backed by models developed by others to not have to worry about this, nor have to know which properties are Variant and which are not. If the generated code is Variant-aware, the properties have fallback incorporated and you are back to simply using |
Ah i see what you are saying. All good, just not sure if that work will overlap with the ext stuff or not, maybe not! |
I think both approaches could live side-by-side, as it's only a change to the existing property-getter, not interfering or inhibiting any extension-methods, as you call them. Thanks for your thoughts. Is there a way to link my PR to this issue or is it too late now? |
@jvtroyen it's basically linked with the mention of it, else you can edit the very first comment in this thread with a link to it too |
Like I've commented on PR #236 (comment), if this gets implemented, it should be done as an attribute (similair to |
One thing to note though: |
Currently, if you want to provide language fallback on properties, you need to provide partial classes and implement it for each Variant property.
It would be nice if there was an appSetting to enable generated code to do this automatically.
[ImplementPropertyType("message")]
public string Message => this.Value("message", fallback: Fallback.ToLanguage);
(I've already started work on a PR #236)
The text was updated successfully, but these errors were encountered: