How to Add Generation Rules for Model Builder in Umbraco 12 Application?
I need to ignore some fields while generating the models, in my Umbraco 8 application I am using IgnorePropertyType attribute from Umbraco.ModelsBuilder.
For example:
[IgnorePropertyType("allowedGroups")]
public partial class WebComponent
{
}
I need the same to implement in my Umbraco 12 application.
'I think' IgnorePropertyType was part of the Original Modelsbuilder project and wasn't imported into the core version when it was made part of the project?
(I could be wrong)
The only project I've seen for Umbraco .NET Core versions that appears to extend Modelsbuilder is Limbo Models Builder:
I tried to use the Limbo.Umbraco.ModelsBuilder
I created a separate class with the same name as the one generated and added IgnorePropertyType attribute with the field names which ones should be ignored but it doesn't work.
I also added
in the models application csproj file.
Could you please explain me how should I config that?
How to Add Generation Rules for Model Builder in Umbraco 12 Application?
I need to ignore some fields while generating the models, in my Umbraco 8 application I am using IgnorePropertyType attribute from Umbraco.ModelsBuilder.
For example:
I need the same to implement in my Umbraco 12 application.
Hi Tate
'I think' IgnorePropertyType was part of the Original Modelsbuilder project and wasn't imported into the core version when it was made part of the project?
(I could be wrong)
The only project I've seen for Umbraco .NET Core versions that appears to extend Modelsbuilder is Limbo Models Builder:
https://github.com/limbo-works/Limbo.Umbraco.ModelsBuilder/tree/v1/main
This would I think give you more control over how the models are generated.
regards
Marc
Hi Marc,
thanks for your response.
I tried to use the Limbo.Umbraco.ModelsBuilder I created a separate class with the same name as the one generated and added IgnorePropertyType attribute with the field names which ones should be ignored but it doesn't work.
I also added in the models application csproj file.
Could you please explain me how should I config that?
Best regards, Tate
is working on a reply...