Giter Site home page Giter Site logo

Comments (3)

abjerner avatar abjerner commented on July 17, 2024

Hi @tatevmkrtchyan

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.

tatevmkrtchyan avatar tatevmkrtchyan commented on July 17, 2024

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.

abjerner avatar abjerner commented on July 17, 2024

Hi @tatevmkrtchyan

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.