Comments (3)
Could you share some examples of your code? In case there is a bug in the package, could you specify exact versions of Umbraco and this package?
Anyways - it seems to work fine when I test, but the attribute is case sensitive - meaning you have the specify the property alias, not the property name. IIRC this aligns with what the old models builder for Umbraco 8 did, but one could argue that it should be case insensitive - hence #17.
Models with inheritance or compositions can also be a bit tricky, so if a property is inherited, you need to add the attribute to the model that declares the property.
Hope that makes sense 😉
from limbo.umbraco.modelsbuilder.
Hi @abjerner,
Thank you for your response, in my application
- Umbraco.Cms version is 12.0.1,
- Limbo.Umbraco.ModelsBuilder version is 2.0.4
I am using those configs for model builder
"ModelsBuilder": {
"ModelsMode": "Nothing",
"FlagOutOfDateModels": true,
"AcceptUnsafeModelsDirectory": true,
"ModelsDirectory": "~/../Models/Generated/"
}
In Models.Generated namespace I added the generation rules in this way:
using Limbo.Umbraco.ModelsBuilder.Attributes;
namespace Models.Generated
{
[IgnorePropertyType("allowedGroup")]
public partial class PersonalLink
{
}
[IgnorePropertyType("image")]
[IgnorePropertyType("searchBar")]
public partial class ArticleOverview
{
}
[IgnorePropertyType("allowedGroups")]
public partial class WebComponent
{
}
[IgnorePropertyType("buttons")]
public partial class NotificationWebComponent
{
}
...
}
The models are getting generated in the subfolders of /Models/Generated/ folder and with those namespaces:
Umbraco.Cms.Web.Common.PublishedModels.Elements
Umbraco.Cms.Web.Common.PublishedModels.Compositions
Umbraco.Cms.Web.Common.PublishedModels.Content.Compositions, etc.
Without ignoring any property.
I also tried to write the generation rules in those two namespaces
Models.Generated.Elements
and
Umbraco.Cms.Web.Common.PublishedModels.Elements
Again I didn't get the expected result.
I can provide more details if needed, please let me know what else I should do to fix the issue.
Best regards,
Tate
from limbo.umbraco.modelsbuilder.
Can you share some examples from the generated partials? Of possibly how the content types look in the backoffice?
From what I can tell, you're using the attributes correctly. But like mentioned earlier, there could be things like compositions that come into play as well, but I can't really see whether that is the case from the provided information.
from limbo.umbraco.modelsbuilder.
Related Issues (14)
- Getting Started Questions/Issues HOT 8
- Investigate deleting files before generating models HOT 4
- Generate Dictionary Items in a strongly-typed fashion HOT 5
- Nested Content Properties being generated with empty types HOT 3
- [ImplementPropertyType()] Attribute being ignored for customized property names HOT 2
- Version 2.0.0-alpha002 - NuGet "DirectoryNotFoundException" for "staticwebassets" HOT 4
- Logic behind `[IgnorePropertyType]` should be case insentive
- Models generator doesn't detect classes in partial classes using file-scoped namespaces
- Feature Request: Add in Static Getters for Compositions HOT 14
- Don't generate interface properties for customized interface properties HOT 5
- Smidge JS conflict with Umbraco Deploy and Umbraco Forms dashboards HOT 5
- Generating sets invalid type for nested classes
- Build warning "warning CS0108" should be ignored HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from limbo.umbraco.modelsbuilder.