Rewords additional code comments as complete sentences

This commit is contained in:
BinaryAlley committed 2026-09-13 20:40:46 +03:00
1 parent 36e43b7999
commit 871644b3c9
23 files changed
+171 -140

No files matched your search

@@ -1,4 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Primitives;
using System;
#endregion
@@ -21,9 +22,9 @@ public abstract class Entity<TId> : IEquatable<Entity<TId>> where TId : notnull
public DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets the date and time when the entity was last updated.
/// Gets the date and time when the entity was last updated, if applicable.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
public Optional<DateTime> UpdatedOnUtc { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Entity{TId}"/> class.
@@ -2,7 +2,6 @@
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Common.Models.Core;
using Lumina.Domain.Common.Errors;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
@@ -49,17 +48,9 @@ public class LanguageInfo : ValueObject
/// <param name="languageCode">The ISO 639-1 two-letter language code.</param>
/// <param name="languageName">The full name of the language in English.</param>
/// <param name="nativeName">The optional native name of the language.</param>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either a successfully created <see cref="LanguageInfo"/>, or an error message.
/// </returns>
public static Result<LanguageInfo> Create(string? languageCode, string? languageName, Optional<string> nativeName)
/// <returns>The created <see cref="LanguageInfo"/>.</returns>
public static LanguageInfo Create(string languageCode, string languageName, Optional<string> nativeName)
{
if (string.IsNullOrWhiteSpace(languageCode))
return Errors.Errors.Metadata.LanguageCodeCannotBeEmpty;
if (string.IsNullOrWhiteSpace(languageName))
return Errors.Errors.Metadata.LanguageNameCannotBeEmpty;
if (languageCode.Length != 2)
return Errors.Errors.Metadata.InvalidIsoCode;
return new LanguageInfo(languageCode, languageName, nativeName);
}
@@ -185,7 +185,7 @@ public sealed class Book : AggregateRoot<BookId>
BarnesAndNobleId = barnesAndNobleId;
AppleBooksId = appleBooksId;
CreatedOnUtc = createdOnUtc;
UpdatedOnUtc = updatedOnUtc.HasValue ? updatedOnUtc.Value : null;
UpdatedOnUtc = updatedOnUtc;
_isbns = isbns;
_contributors = [.. contributors];
_ratings = ratings;
@@ -237,7 +237,7 @@ public sealed class Book : AggregateRoot<BookId>
IEnumerable<BookMediaContributor> contributors,
List<BookRating> ratings)
{
// TODO: enforce invariants
// TODO: enforce invariants.
return new Book(
BookId.CreateUnique(),
libraryId,
@@ -256,7 +256,7 @@ public sealed class Book : AggregateRoot<BookId>
googleBooksId,
barnesAndNobleId,
appleBooksId,
DateTime.UtcNow, // TODO: should be IDateTimeProvider
DateTime.UtcNow, // TODO: should be IDateTimeProvider.
default,
isbns,
contributors,
@@ -316,7 +316,7 @@ public sealed class Book : AggregateRoot<BookId>
IEnumerable<BookMediaContributor> contributors,
List<BookRating> ratings)
{
// TODO: enforce invariants
// TODO: enforce invariants.
return new Book(
id,
libraryId,
@@ -350,7 +350,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="contributors">The media contributors of the book.</param>
public void UpdateContributors(IReadOnlyCollection<BookMediaContributor> contributors)
{
// replace the contents of the collection in place, preserving the readonly reference invariants of the aggregate
// Replace the contents of the collection in place, preserving the readonly reference invariants of the aggregate.
_contributors.Clear();
_contributors.UnionWith(contributors);
}
@@ -406,7 +406,7 @@ public sealed class Book : AggregateRoot<BookId>
GoogleBooksId = googleBooksId;
BarnesAndNobleId = barnesAndNobleId;
AppleBooksId = appleBooksId;
// replace the contents of the collections in place, preserving the readonly reference invariants of the aggregate
// Replace the contents of the collections in place, preserving the readonly reference invariants of the aggregate.
_isbns.Clear();
_isbns.AddRange(isbns);
_ratings.Clear();