Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Template References section for static classes #41

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions helix/principles/templates/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Define constants for a module’s templates in a single static class named
``Templates``. This static class is located in the root namespace for the module.
This makes it easy to explicitly reference a template in the business
logic or views of the module and makes it easier to discover references to a template
or field. The conventions define this as a static class to clearly signal the
``Templates`` type's unique function as a constants holder only, following the
`conventions for Constants in the Microsoft C# Programming Guide <https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-define-constants>`__.
or field. The conventions define this as a static class to follow the
`conventions for Constants in the Microsoft C# Programming Guide <https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-define-constants>`__, as it indicates that the type
can only contain static members, including constants, and cannot be mistakenly instantiated or derived from.

The ``Templates`` static class should have a nested static class for each template
which each contains an ID member and a nested static class, Fields, which
Expand Down Expand Up @@ -139,4 +139,4 @@ rather an *is* operator.
.Select(x => new {
Uri = x.UniqueId,
Database = Factory.GetDatabase(x.UniqueId.DatabaseName)
}).ToList();
}).ToList();