Skip to content

Commit

Permalink
Merge pull request #41 from sergey-krivchenko/patch-1
Browse files Browse the repository at this point in the history
Updated Template References section for static classes
  • Loading branch information
nickwesselman authored Dec 14, 2021
2 parents 410ee58 + 8d6a540 commit f8caea1
Showing 1 changed file with 4 additions and 4 deletions.
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();

0 comments on commit f8caea1

Please sign in to comment.