what does the model.generated.cs file do in Umbraco?
Exploring Umbraco 8 and playing around building a test site etc.
Building document types and content pages via the back office interface, and looking in the code itself I've noticed a files called models.generated.cs.
looking inside, it contains partial classes like:
public partial class AndyTestPage : PublishedContentModel { }
and properties I've given it like :
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.5.5")]
[ImplementPropertyType("andyProperty1")]
public string AndyProperty1 => this.Value
my question is, what exactly is the point of this file? what does is do and how are these properties and classes created in here via the backoffice cms.
second question is, how would I go about creating a document type, and properties from code? my noob assumption is to simply add the classes in the this file, but that doesnt seem right?
what does the model.generated.cs file do in Umbraco?
Exploring Umbraco 8 and playing around building a test site etc.
Building document types and content pages via the back office interface, and looking in the code itself I've noticed a files called models.generated.cs.
looking inside, it contains partial classes like: public partial class AndyTestPage : PublishedContentModel { }
and properties I've given it like :
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.5.5")] [ImplementPropertyType("andyProperty1")] public string AndyProperty1 => this.Value
my question is, what exactly is the point of this file? what does is do and how are these properties and classes created in here via the backoffice cms.
second question is, how would I go about creating a document type, and properties from code? my noob assumption is to simply add the classes in the this file, but that doesnt seem right?
Thanks,
Andy
Models builder only creates classes from the back office and not from code.
So the simple answer right now is you can't.
Long answer is you could extend it to do (I have no idea how)
Matt
is working on a reply...