From ed11af203ead7318af1bb14824b83032cd712706 Mon Sep 17 00:00:00 2001 From: "hualin.zhu" Date: Fri, 8 Nov 2024 19:05:06 +0800 Subject: [PATCH] Add Detailed Annotations to Code Templates for Better Understanding --- src/Templatemap.cs | 2 ++ src/Templates/Caching/.cachekey.cs.txt | 19 ++++++++++-- src/Templates/Commands/AddEdit/.cs.txt | 27 +++++++++++++++-- .../Commands/AddEdit/.validator.cs.txt | 26 ++++++++++++++-- src/Templates/Commands/Create/.cs.txt | 28 +++++++++++++++-- .../Commands/Create/.validator.cs.txt | 27 +++++++++++++++-- src/Templates/Commands/Delete/.cs.txt | 29 ++++++++++++++++-- .../Commands/Delete/.validator.cs.txt | 27 +++++++++++++++-- src/Templates/Commands/Import/.cs.txt | 29 ++++++++++++++++-- .../Commands/Import/.validator.cs.txt | 27 +++++++++++++++-- src/Templates/Commands/Update/.cs.txt | 28 +++++++++++++++-- .../Commands/Update/.validator.cs.txt | 30 +++++++++++++++++-- src/Templates/DTOs/.dto.cs.txt | 29 ++++++++++++++++-- src/Templates/EventHandlers/.created.cs.txt | 18 +++++++++-- src/Templates/EventHandlers/.deleted.cs.txt | 18 +++++++++-- src/Templates/EventHandlers/.updated.cs.txt | 18 +++++++++-- src/Templates/Events/.createdevent.cs.txt | 16 ++++++++-- src/Templates/Events/.deletedevent.cs.txt | 16 ++++++++-- src/Templates/Events/.updatedevent.cs.txt | 16 ++++++++-- src/Templates/Mappers/.mapper.cs.txt | 19 ++++++++++-- src/Templates/PermissionSet/.cs.txt | 17 +++++++++-- .../Configurations/.configuration.cs.txt | 16 ++++++++-- src/Templates/Queries/Export/.cs.txt | 18 +++++++++-- src/Templates/Queries/GetAll/.cs.txt | 17 +++++++++-- src/Templates/Queries/GetById/.cs.txt | 16 ++++++++-- src/Templates/Queries/Pagination/.cs.txt | 16 ++++++++-- .../Specifications/AdvancedFilter.cs.txt | 16 ++++++++++ .../AdvancedSpecification.cs.txt | 15 ++++++++++ .../Specifications/ByIdSpecification.cs.txt | 16 +++++++++- 29 files changed, 543 insertions(+), 53 deletions(-) diff --git a/src/Templatemap.cs b/src/Templatemap.cs index d7017fb..6ef22e8 100644 --- a/src/Templatemap.cs +++ b/src/Templatemap.cs @@ -157,6 +157,8 @@ private static async Task ReplaceTokensAsync(Project project, Intellisen { "rootnamespace", _defaultNamespace }, { "namespace", ns }, { "selectns", selectNs }, + { "author", "neozhu"}, + { "createddate", DateTime.Now.ToString("yyyy-MM-dd") }, { "itemname", name }, { "itemnamelowercase", name.ToLower() }, { "nameofPlural", nameofPlural }, diff --git a/src/Templates/Caching/.cachekey.cs.txt b/src/Templates/Caching/.cachekey.cs.txt index 6294c10..1c74f6e 100644 --- a/src/Templates/Caching/.cachekey.cs.txt +++ b/src/Templates/Caching/.cachekey.cs.txt @@ -1,5 +1,20 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines static methods and properties for managing cache keys and expiration +// settings for {itemname}-related data. This includes creating unique cache keys for +// various {itemnamelowercase} queries (such as getting all {itemnamelowercase}s, {itemnamelowercase}s by ID, etc.), +// managing the cache expiration tokens to control cache validity, and providing a +// mechanism to refresh cached data in a thread-safe manner. +// +//------------------------------------------------------------------------------ namespace {namespace}; /// diff --git a/src/Templates/Commands/AddEdit/.cs.txt b/src/Templates/Commands/AddEdit/.cs.txt index 5fc7a8e..c4598fe 100644 --- a/src/Templates/Commands/AddEdit/.cs.txt +++ b/src/Templates/Commands/AddEdit/.cs.txt @@ -1,7 +1,28 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the command for adding or editing a {itemnamelowercase} entity, +// including validation and mapping operations. It handles domain events +// and cache invalidation for updated or newly created {itemnamelowercase}. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// This command can be used to add a new {itemnamelowercase} or edit an existing one. +// It handles caching logic and domain event raising automatically. + -using {selectns}.{nameofPlural}.DTOs; using {selectns}.{nameofPlural}.Caching; using {selectns}.{nameofPlural}.Mappers; diff --git a/src/Templates/Commands/AddEdit/.validator.cs.txt b/src/Templates/Commands/AddEdit/.validator.cs.txt index 2ad6d46..9e83884 100644 --- a/src/Templates/Commands/AddEdit/.validator.cs.txt +++ b/src/Templates/Commands/AddEdit/.validator.cs.txt @@ -1,5 +1,27 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the validation rules for the AddEdit{itemname}Command +// used to add or edit {itemname} entities within the CleanArchitecture.Blazor +// application. It enforces maximum field lengths and required properties +// to maintain data integrity and validation standards. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// This validator enforces constraints on the AddEditContactCommand, such as +// maximum field length for ... namespace {namespace}; diff --git a/src/Templates/Commands/Create/.cs.txt b/src/Templates/Commands/Create/.cs.txt index 691540d..cbd4b7c 100644 --- a/src/Templates/Commands/Create/.cs.txt +++ b/src/Templates/Commands/Create/.cs.txt @@ -1,5 +1,29 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the command and its handler for creating a new {itemname} entity +// within the CleanArchitecture.Blazor application. The command uses caching +// invalidation to ensure data consistency and raises domain events to maintain +// the integrity of the entity lifecycle. It leverages Clean Architecture principles +// for separation of concerns and encapsulation. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// This command can be used to create a new {itemnamelowercase} entity in the system. It includes +// the required fields for the {itemnamelowercase} and automatically raises necessary domain +// events for integration with other bounded contexts in the application. using {selectns}.{nameofPlural}.Caching; using {selectns}.{nameofPlural}.Mappers; diff --git a/src/Templates/Commands/Create/.validator.cs.txt b/src/Templates/Commands/Create/.validator.cs.txt index ebcd865..1191f20 100644 --- a/src/Templates/Commands/Create/.validator.cs.txt +++ b/src/Templates/Commands/Create/.validator.cs.txt @@ -1,5 +1,28 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the validation rules for the Create{itemname}Command, +// used to create {itemname} entities within the CleanArchitecture.Blazor +// application. It ensures that essential fields are validated correctly, +// including maximum lengths and mandatory requirements for required fields. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// This validator is used to ensure that a Create{itemname}Command meets the required +// validation criteria. It enforces constraints like maximum field lengths and +// ensures that the Name field is not empty before proceeding with the command execution. namespace {namespace}; diff --git a/src/Templates/Commands/Delete/.cs.txt b/src/Templates/Commands/Delete/.cs.txt index 2ff263a..500e860 100644 --- a/src/Templates/Commands/Delete/.cs.txt +++ b/src/Templates/Commands/Delete/.cs.txt @@ -1,5 +1,30 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the command and its handler for deleting one or more +// {itemname} entities from the CleanArchitecture.Blazor application. It +// implements caching invalidation logic to ensure that data consistency is +// maintained. Domain events are triggered for deleted entities to support +// integration with other parts of the system. +// for separation of concerns and encapsulation. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// This command can be used to delete multiple {nameofPlural} from the system by specifying +// their IDs. The handler also raises domain events for each deleted {itemnamelowercase} to +// notify other bounded contexts and invalidate relevant cache entries. using {selectns}.{nameofPlural}.Caching; diff --git a/src/Templates/Commands/Delete/.validator.cs.txt b/src/Templates/Commands/Delete/.validator.cs.txt index feb3c60..3168a88 100644 --- a/src/Templates/Commands/Delete/.validator.cs.txt +++ b/src/Templates/Commands/Delete/.validator.cs.txt @@ -1,5 +1,28 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the validation rules for the Delete{itemname}Command used +// to delete {itemname} entities within the CleanArchitecture.Blazor application. +// It ensures that the command has valid input, particularly verifying that the +// list of {itemnamelowercase} IDs to delete is not null and contains only positive IDs. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// This validator ensures that the Delete{itemname}Command is valid before attempting +// to delete {itemnamelowercase} records from the system. It verifies that the ID list is not +// null and that all IDs are greater than zero. namespace {namespace}; diff --git a/src/Templates/Commands/Import/.cs.txt b/src/Templates/Commands/Import/.cs.txt index d86c2e6..68964cc 100644 --- a/src/Templates/Commands/Import/.cs.txt +++ b/src/Templates/Commands/Import/.cs.txt @@ -1,5 +1,30 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the command, handler, and associated logic for importing +// {itemnamelowercase}s from an Excel file into the CleanArchitecture.Blazor application. +// The import process supports validating data and ensuring no duplicates are +// inserted. Additionally, a command for creating a {itemnamelowercase} template file is provided +// to facilitate bulk data entry for end users. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// - Use `Import{itemname}sCommand` to import {itemnamelowercase}s from an Excel file, ensuring proper validation +// and avoiding duplicates. +// - Use `Create{itemname}sTemplateCommand` to generate an Excel template for entering {itemnamelowercase} data +// that can be later imported using the import command. using {selectns}.{nameofPlural}.DTOs; using {selectns}.{nameofPlural}.Caching; diff --git a/src/Templates/Commands/Import/.validator.cs.txt b/src/Templates/Commands/Import/.validator.cs.txt index 0070736..c7e2482 100644 --- a/src/Templates/Commands/Import/.validator.cs.txt +++ b/src/Templates/Commands/Import/.validator.cs.txt @@ -1,5 +1,28 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the validation rules for the Import{itemname}sCommand +// within the CleanArchitecture.Blazor application. It ensures that the +// command's required properties are correctly set before proceeding with +// the {itemnamelowercase} import process. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// This validator is used to ensure that an Import{itemname}sCommand has valid input +// before attempting to import {itemnamelowercase} data. It checks that the Data property is not +// null and is not empty, ensuring that the command has valid content for import. namespace {namespace}; diff --git a/src/Templates/Commands/Update/.cs.txt b/src/Templates/Commands/Update/.cs.txt index a2e53ef..8c30eea 100644 --- a/src/Templates/Commands/Update/.cs.txt +++ b/src/Templates/Commands/Update/.cs.txt @@ -1,5 +1,29 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the Update{itemname}Command and its handler for updating +// an existing {itemname} entity within the CleanArchitecture.Blazor application. +// It includes caching invalidation logic to maintain data consistency and +// raises a domain event upon successful update to notify other parts of the system. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// Use `Update{itemname}Command` to update an existing {itemnamelowercase} entity in the system. +// The handler ensures that if the entity is found, the changes are applied and +// the necessary domain event (`{itemname}UpdatedEvent`) is raised. Caching is also +// invalidated to keep the {itemnamelowercase} list consistent. using {selectns}.{nameofPlural}.Caching; using {selectns}.{nameofPlural}.Mappers; diff --git a/src/Templates/Commands/Update/.validator.cs.txt b/src/Templates/Commands/Update/.validator.cs.txt index 09dd4e2..597d0f2 100644 --- a/src/Templates/Commands/Update/.validator.cs.txt +++ b/src/Templates/Commands/Update/.validator.cs.txt @@ -1,5 +1,31 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the validation rules for the Update{itemname}Command within +// the CleanArchitecture.Blazor application. It ensures that the command has +// all required fields properly populated and validates constraints such as +// maximum length and non-null requirements before proceeding with updating +// a {itemnamelowercase}. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// The `Update{itemname}CommandValidator` is used to validate that an `Update{itemname}Command` +// contains valid and complete data before processing the update. It enforces rules such as +// ensuring that the `Id` is provided, the `Name` is not empty, and certain properties +// (e.g., ...) do not exceed their maximum +// allowed length. namespace {namespace}; diff --git a/src/Templates/DTOs/.dto.cs.txt b/src/Templates/DTOs/.dto.cs.txt index a8f55c5..843d567 100644 --- a/src/Templates/DTOs/.dto.cs.txt +++ b/src/Templates/DTOs/.dto.cs.txt @@ -1,5 +1,30 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// This file defines the Data Transfer Object (DTO) for the {itemname} entity +// used within the CleanArchitecture.Blazor application. The {itemname}Dto is +// responsible for transferring data between layers while maintaining the +// structure and format required by application features like commands, queries, +// and views. +// +// Documentation: +// https://docs.cleanarchitectureblazor.com/features/{itemnamelowercase} +// +//------------------------------------------------------------------------------ + +// Usage: +// The `{itemname}Dto` class is used to represent {itemnamelowercase} data throughout the CleanArchitecture.Blazor +// application, providing a well-defined contract for passing {itemnamelowercase} information between different +// layers and services. Each property includes a description for better understandability during +// serialization and documentation generation. namespace {namespace}; diff --git a/src/Templates/EventHandlers/.created.cs.txt b/src/Templates/EventHandlers/.created.cs.txt index cbfd9f3..7a6e1f5 100644 --- a/src/Templates/EventHandlers/.created.cs.txt +++ b/src/Templates/EventHandlers/.created.cs.txt @@ -1,5 +1,19 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Handles the `{itemname}CreatedEvent` which occurs when a new {itemnamelowercase} is created. +// This event handler can be extended to trigger additional actions, such as +// sending notifications or updating other systems. +// +//------------------------------------------------------------------------------ namespace {namespace}; diff --git a/src/Templates/EventHandlers/.deleted.cs.txt b/src/Templates/EventHandlers/.deleted.cs.txt index d3df4bd..9a64479 100644 --- a/src/Templates/EventHandlers/.deleted.cs.txt +++ b/src/Templates/EventHandlers/.deleted.cs.txt @@ -1,5 +1,19 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Handles the `{itemname}DeletedEvent` which occurs when a new {itemnamelowercase} is deleted. +// This event handler can be extended to trigger additional actions, such as +// sending notifications or updating other systems. +// +//------------------------------------------------------------------------------ namespace {namespace}; diff --git a/src/Templates/EventHandlers/.updated.cs.txt b/src/Templates/EventHandlers/.updated.cs.txt index 2c373ef..50ad2fb 100644 --- a/src/Templates/EventHandlers/.updated.cs.txt +++ b/src/Templates/EventHandlers/.updated.cs.txt @@ -1,5 +1,19 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Handles the `{itemname}UpdatedEvent` which occurs when a new {itemnamelowercase} is updated. +// This event handler can be extended to trigger additional actions, such as +// sending notifications or updating other systems. +// +//------------------------------------------------------------------------------ namespace {namespace}; diff --git a/src/Templates/Events/.createdevent.cs.txt b/src/Templates/Events/.createdevent.cs.txt index 7e8b560..46ecb66 100644 --- a/src/Templates/Events/.createdevent.cs.txt +++ b/src/Templates/Events/.createdevent.cs.txt @@ -1,5 +1,17 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Represents a domain event that occurs when a new {itemnamelowercase} is created. +// Used to signal other parts of the system that a new {itemnamelowercase} has been added. +// +//------------------------------------------------------------------------------ namespace {namespace}; diff --git a/src/Templates/Events/.deletedevent.cs.txt b/src/Templates/Events/.deletedevent.cs.txt index 64840a6..6ad6198 100644 --- a/src/Templates/Events/.deletedevent.cs.txt +++ b/src/Templates/Events/.deletedevent.cs.txt @@ -1,5 +1,17 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Represents a domain event that occurs when a new {itemnamelowercase} is deleted. +// Used to signal other parts of the system that a new {itemnamelowercase} has been deleted. +// +//------------------------------------------------------------------------------ namespace {namespace}; diff --git a/src/Templates/Events/.updatedevent.cs.txt b/src/Templates/Events/.updatedevent.cs.txt index 6a21c61..ed3c43f 100644 --- a/src/Templates/Events/.updatedevent.cs.txt +++ b/src/Templates/Events/.updatedevent.cs.txt @@ -1,5 +1,17 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Represents a domain event that occurs when a new {itemnamelowercase} is updated. +// Used to signal other parts of the system that a new {itemnamelowercase} has been updated. +// +//------------------------------------------------------------------------------ namespace {namespace}; diff --git a/src/Templates/Mappers/.mapper.cs.txt b/src/Templates/Mappers/.mapper.cs.txt index ab9e08b..7ad8891 100644 --- a/src/Templates/Mappers/.mapper.cs.txt +++ b/src/Templates/Mappers/.mapper.cs.txt @@ -1,5 +1,20 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines mapping methods between `{itemname}` entities and related DTOs/commands +// within the CleanArchitecture.Blazor application. This mapper facilitates +// conversions to support different operations, such as creating, updating, +// and projecting {itemnamelowercase} data. +// +//------------------------------------------------------------------------------ using {selectns}.{nameofPlural}.Commands.AddEdit; using {selectns}.{nameofPlural}.Commands.Create; diff --git a/src/Templates/PermissionSet/.cs.txt b/src/Templates/PermissionSet/.cs.txt index bba6b5c..6606c87 100644 --- a/src/Templates/PermissionSet/.cs.txt +++ b/src/Templates/PermissionSet/.cs.txt @@ -1,5 +1,18 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines permission constants for {itemnamelowercase}-related operations, such as +// viewing, creating, editing, deleting, and more. These permissions are +// used to manage access control within the application. +// +//------------------------------------------------------------------------------ using System.ComponentModel; diff --git a/src/Templates/Persistence/Configurations/.configuration.cs.txt b/src/Templates/Persistence/Configurations/.configuration.cs.txt index 8e41beb..4aa2508 100644 --- a/src/Templates/Persistence/Configurations/.configuration.cs.txt +++ b/src/Templates/Persistence/Configurations/.configuration.cs.txt @@ -1,5 +1,17 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Configures the properties and behaviors for the `{itemname}` entity in the +// database. Specifies property constraints such as maximum length and required fields. +// +//------------------------------------------------------------------------------ using Microsoft.EntityFrameworkCore.Metadata.Builders; diff --git a/src/Templates/Queries/Export/.cs.txt b/src/Templates/Queries/Export/.cs.txt index b92632f..bd34be1 100644 --- a/src/Templates/Queries/Export/.cs.txt +++ b/src/Templates/Queries/Export/.cs.txt @@ -1,10 +1,22 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines a query to export {itemnamelowercase} data to an Excel file. This query +// applies advanced filtering options and generates an Excel file with +// the specified {itemnamelowercase} details. +// +//------------------------------------------------------------------------------ using {selectns}.{nameofPlural}.DTOs; using {selectns}.{nameofPlural}.Mappers; using {selectns}.{nameofPlural}.Specifications; -using {selectns}.{nameofPlural}.Queries.Pagination; namespace {namespace}; diff --git a/src/Templates/Queries/GetAll/.cs.txt b/src/Templates/Queries/GetAll/.cs.txt index 2e32788..a4ed532 100644 --- a/src/Templates/Queries/GetAll/.cs.txt +++ b/src/Templates/Queries/GetAll/.cs.txt @@ -1,5 +1,18 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines a query to retrieve all {itemnamelowercase}s from the database. The result +// is cached to improve performance and reduce database load for repeated +// queries. +// +//------------------------------------------------------------------------------ using {selectns}.{nameofPlural}.DTOs; using {selectns}.{nameofPlural}.Mappers; diff --git a/src/Templates/Queries/GetById/.cs.txt b/src/Templates/Queries/GetById/.cs.txt index c93b04a..97cf04e 100644 --- a/src/Templates/Queries/GetById/.cs.txt +++ b/src/Templates/Queries/GetById/.cs.txt @@ -1,5 +1,17 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines a query to retrieve a {itemnamelowercase} by its ID. The result is cached +// to optimize performance for repeated retrievals of the same {itemnamelowercase}. +// +//------------------------------------------------------------------------------ using {selectns}.{nameofPlural}.DTOs; using {selectns}.{nameofPlural}.Caching; diff --git a/src/Templates/Queries/Pagination/.cs.txt b/src/Templates/Queries/Pagination/.cs.txt index 2d33038..29c89db 100644 --- a/src/Templates/Queries/Pagination/.cs.txt +++ b/src/Templates/Queries/Pagination/.cs.txt @@ -1,5 +1,17 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines a query for retrieving {itemnamelowercase}s with pagination and filtering +// options. The result is cached to enhance performance for repeated queries. +// +//------------------------------------------------------------------------------ using {selectns}.{nameofPlural}.DTOs; using {selectns}.{nameofPlural}.Caching; diff --git a/src/Templates/Specifications/AdvancedFilter.cs.txt b/src/Templates/Specifications/AdvancedFilter.cs.txt index 9a311e6..fd69470 100644 --- a/src/Templates/Specifications/AdvancedFilter.cs.txt +++ b/src/Templates/Specifications/AdvancedFilter.cs.txt @@ -1,3 +1,19 @@ +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines the available views for filtering {itemnamelowercase}s and provides advanced +// filtering options for {itemnamelowercase} lists. This includes pagination and various +// filters such as view types and user-specific filters. +// +//------------------------------------------------------------------------------ + namespace {namespace}; #nullable disable warnings diff --git a/src/Templates/Specifications/AdvancedSpecification.cs.txt b/src/Templates/Specifications/AdvancedSpecification.cs.txt index e8941e0..dd99cf6 100644 --- a/src/Templates/Specifications/AdvancedSpecification.cs.txt +++ b/src/Templates/Specifications/AdvancedSpecification.cs.txt @@ -1,3 +1,18 @@ +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines a specification for applying advanced filtering options to the +// {itemname} entity, supporting different views and keyword-based searches. +// +//------------------------------------------------------------------------------ + namespace {namespace}; #nullable disable warnings /// diff --git a/src/Templates/Specifications/ByIdSpecification.cs.txt b/src/Templates/Specifications/ByIdSpecification.cs.txt index c62fed3..15397c9 100644 --- a/src/Templates/Specifications/ByIdSpecification.cs.txt +++ b/src/Templates/Specifications/ByIdSpecification.cs.txt @@ -1,4 +1,18 @@ -namespace {namespace}; +//------------------------------------------------------------------------------ +// +// This file is part of the CleanArchitecture.Blazor project. +// Licensed to the .NET Foundation under the MIT license. +// See the LICENSE file in the project root for more information. +// +// Author: {author} +// Created Date: {createddate} +// Last Modified: {createddate} +// Description: +// Defines a specification for filtering a {itemname} entity by its ID. +// +//------------------------------------------------------------------------------ + +namespace {namespace}; #nullable disable warnings /// /// Specification class for filtering {nameofPlural} by their ID.