Closed hfloyd closed 2 years ago
Thanks @hfloyd 👍
This looks great, although I might move it a bit around 😉
I'm not sure how many that will actually look at the generated files, but I prefer having #pragma
flags at the file level - then we'll disable the warnings for the entire file.
So in https://github.com/limbo-works/Limbo.Umbraco.ModelsBuilder/commit/07a00a21cd98b62d50fa9edbce469722247c190a, I've introduced a new WritePragma
method. The default implementation has the #pragma warning disable 0109
that you added as well as #pragma warning disable 1591
(Missing XML comment for publicly visible type or member).
The ModelTypeAlias
constant is now also handled by the new WriteConstants
method.
Sounds good! I like the organization :-)
This adds a constant to each generated model that provides the string Content Type alias so that "magic strings" can be avoided in various code applications
example usage:
posts = blog.DescendantsOrSelf(BlogPost.ModelTypeAlias);
instead of:
posts = blog.DescendantsOrSelf("blogPost");