From 776d9bfa9b9303c94bac691e5bcf83e1c988d8fe Mon Sep 17 00:00:00 2001 From: Stephen Walsh Date: Wed, 28 Oct 2026 12:20:45 +0000 Subject: [PATCH] Document the Application models with XML comments Matches the Application layer in CleanMinimalApi and CleanWebApi, where these comments feed the OpenAPI document. Also fixes the NotFoundException.Throw comment. --- src/Application/Application.csproj | 2 ++ src/Application/Authors/Entities/Author.cs | 7 +++++++ src/Application/Authors/Entities/ReviewAuthor.cs | 6 ++++++ .../Common/Exceptions/NotFoundException.cs | 2 +- src/Application/Movies/Entities/Movie.cs | 6 ++++++ src/Application/Movies/Entities/ReviewedMovie.cs | 5 +++++ src/Application/Reviews/Entities/Review.cs | 7 +++++++ src/Application/Versions/Entities/Version.cs | 11 +++++++++++ 8 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/Application/Application.csproj b/src/Application/Application.csproj index 325c85a..46513f3 100644 --- a/src/Application/Application.csproj +++ b/src/Application/Application.csproj @@ -2,6 +2,8 @@ false + true + $(NoWarn);1591 diff --git a/src/Application/Authors/Entities/Author.cs b/src/Application/Authors/Entities/Author.cs index c7d46b5..c3d93e4 100644 --- a/src/Application/Authors/Entities/Author.cs +++ b/src/Application/Authors/Entities/Author.cs @@ -2,4 +2,11 @@ namespace CleanModelContextProtocol.Application.Authors.Entities; using Application.Reviews.Entities; +/// +/// A person who writes movie reviews. +/// +/// The unique identifier of the author. +/// The author's first name. +/// The author's last name. +/// The reviews the author has written. public record Author(Guid Id, string FirstName, string LastName, ICollection Reviews = null); diff --git a/src/Application/Authors/Entities/ReviewAuthor.cs b/src/Application/Authors/Entities/ReviewAuthor.cs index 83f33e1..9ca0392 100644 --- a/src/Application/Authors/Entities/ReviewAuthor.cs +++ b/src/Application/Authors/Entities/ReviewAuthor.cs @@ -1,3 +1,9 @@ namespace CleanModelContextProtocol.Application.Authors.Entities; +/// +/// The author who wrote a review. +/// +/// The unique identifier of the author. +/// The author's first name. +/// The author's last name. public record ReviewAuthor(Guid Id, string FirstName, string LastName); diff --git a/src/Application/Common/Exceptions/NotFoundException.cs b/src/Application/Common/Exceptions/NotFoundException.cs index 8a4b7d1..196ccec 100644 --- a/src/Application/Common/Exceptions/NotFoundException.cs +++ b/src/Application/Common/Exceptions/NotFoundException.cs @@ -17,7 +17,7 @@ public static void ThrowIfNull(object argument, EntityType entityType) } /// Throws a - /// The entity type of the parameter. + /// The entity type that was not found. public static void Throw(EntityType entityType) { throw new NotFoundException($"The {entityType} with the supplied id was not found."); diff --git a/src/Application/Movies/Entities/Movie.cs b/src/Application/Movies/Entities/Movie.cs index 37fd747..a664863 100644 --- a/src/Application/Movies/Entities/Movie.cs +++ b/src/Application/Movies/Entities/Movie.cs @@ -2,4 +2,10 @@ namespace CleanModelContextProtocol.Application.Movies.Entities; using Application.Reviews.Entities; +/// +/// A movie that can be reviewed. +/// +/// The unique identifier of the movie. +/// The title of the movie. +/// The reviews written about the movie. public record Movie(Guid Id, string Title, ICollection Reviews = null); diff --git a/src/Application/Movies/Entities/ReviewedMovie.cs b/src/Application/Movies/Entities/ReviewedMovie.cs index 84acc7f..e303cc6 100644 --- a/src/Application/Movies/Entities/ReviewedMovie.cs +++ b/src/Application/Movies/Entities/ReviewedMovie.cs @@ -1,3 +1,8 @@ namespace CleanModelContextProtocol.Application.Movies.Entities; +/// +/// The movie a review is about. +/// +/// The unique identifier of the movie. +/// The title of the movie. public record ReviewedMovie(Guid Id, string Title); diff --git a/src/Application/Reviews/Entities/Review.cs b/src/Application/Reviews/Entities/Review.cs index c3daa89..580814e 100644 --- a/src/Application/Reviews/Entities/Review.cs +++ b/src/Application/Reviews/Entities/Review.cs @@ -3,6 +3,13 @@ namespace CleanModelContextProtocol.Application.Reviews.Entities; using Application.Authors.Entities; using Application.Movies.Entities; +/// +/// A star rating an author has given a movie. +/// +/// The unique identifier of the review. +/// The star rating, from 1 to 5. +/// The movie that was reviewed. +/// The author who wrote the review. public record Review( Guid Id, int Stars, diff --git a/src/Application/Versions/Entities/Version.cs b/src/Application/Versions/Entities/Version.cs index 76d2391..1c064ee 100644 --- a/src/Application/Versions/Entities/Version.cs +++ b/src/Application/Versions/Entities/Version.cs @@ -1,8 +1,19 @@ namespace CleanModelContextProtocol.Application.Versions.Entities; +/// +/// The version details of the running application. +/// public class Version { + /// + /// The assembly file version. + /// + /// 1.1.0.0 public string FileVersion { get; init; } + /// + /// The informational version, which can include a pre-release label or commit hash. + /// + /// 1.1.0+e30eba8 public string InformationalVersion { get; init; } }