Skip to content

Conversation

@TyKonKet
Copy link

This PR enhances and completes the XML documentation (/// comments) for LiteDB's public API, focusing on public types, methods, properties, and events. The goal is to provide better IntelliSense support, clearer usage guidance, and to help both maintainers and users understand the responsibilities and semantics of each API component.

All changes are grouped by logical type areas, with each commit covering 1–3 related classes. These include core database classes, mapping types, storage abstractions, and collection interfaces.

Why this change matters:

  • Improves developer experience: well-documented APIs make it much easier for consumers to discover and use functionality reliably.
  • Encourages correct usage: XML comments clarify method purpose, parameters, return values, and expected behavior.
  • Maintains consistency: providing documentation across the public-facing API helps keep the project maintainable and lowers the barrier for contributors.

Summary of Documented API Areas

Here is a non-exhaustive list of the API surface that received documentation in this PR (organized by logical groups). Each bullet corresponds roughly to the scope of individual commits:

  • LiteDatabase / Core Engine

    • Construction and initialization of the LiteDatabase instance
    • Properties like Mapper, FileStorage, Timeout, UserVersion, etc. ([litedb.org][1])
    • Methods for storage access, collection retrieval, and engine control
  • Bson / Document Model

    • BsonDocument: semantics of key-value pairs, valid key names, behavior of nested documents
    • BsonValue types and conversion rules (if present in the documented types)
  • Object Mapping / BsonMapper

    • How POCO classes are mapped to BSON documents, conventions for Id fields, null / default handling ([litedb.org][2])
    • Fluent mapping API: EntityBuilder, Id(), Ignore(), Field(), DbRef() ([litedb.org][2])
    • Registration of custom types via RegisterType<T>

Impact and Considerations

Backward compatibility:
This change is non-breaking—it only adds or refines XML documentation comments, without altering any logic or public API signatures.

Testing / Validation:

  • While documentation doesn’t need runtime tests, it can be validated by building the project and verifying that IntelliSense in IDEs (e.g. Visual Studio) shows the new documentation.
  • Optionally, you might consider adding a style or doc-comment checking step in CI to keep the documentation coverage high.

Next Steps / Suggestions:

  • Review the XML documentation to ensure all <param>, <returns>, and <exception> tags are used correctly and consistently.
  • Possibly generate API reference documentation (e.g., with DocFX or Sandcastle) based on these comments.
  • Encourage contributors to document future public API additions using the same style.

Updated and expanded the XML documentation for the `BsonAutoId` enum to clarify its purpose and behavior.
Enhanced and expanded XML documentation across the `LiteDatabase` class to improve clarity, usability, and developer experience.
Enhanced and standardized XML documentation across the `BsonMapper` class to improve clarity, consistency, and usability.
Enhanced inline XML documentation for the `EntityBuilder<T>` class and its methods to improve clarity, usability, and developer experience.
Enhanced the `ConnectionType` enum in the `LiteDB` namespace by adding detailed XML documentation for the enum and its members (`Direct` and `Shared`). The documentation explains their purpose, usage scenarios, and limitations, improving code readability and maintainability.
Enhanced documentation for `Collation` and `LCID` classes:
- Added detailed XML comments for properties, methods, and classes.
- Improved clarity of purpose.
Enhanced XML documentation for `EngineSettings` class and
`SharedMutexNameStrategy` enum to provide clearer descriptions,
usage details, and improved developer navigation.
Added detailed XML documentation to `BsonDocument` and `BsonValue` .
documentation for its purpose, properties, and error codes.
Enhanced XML documentation for methods, properties, and enums to improve clarity and usability. Added `<remarks>` sections for additional context and examples. Updated property and method descriptions for consistency and precision.
Enhanced XML documentation across `ILiteStorage<TFileId>`,
`LiteFileInfo<TFileId>`, `LiteFileStream<TFileId>`, and
`LiteStorage<TFileId>` to provide detailed explanations,
examples, and best practices. Updated method descriptions
for clarity and aligned them with functionality.
Enhanced and standardized XML documentation for the `ConnectionString` class:
- Expanded the summary to include detailed explanations and examples.
- Added a remarks section with a table of supported parameters.
- Improved property documentation with consistent descriptions, default values, and `<see cref="..."/>` references.
- Refined constructor documentation, including `<param>` and `<exception>` tags.
- Updated indexer documentation with `<param>` and `<returns>` tags.
- Standardized formatting and terminology across all comments.
- Improved IntelliSense integration with `<see langword="null"/>` and `<see cref="..."/>` references.
Enhanced the `BsonDataReader` class with detailed XML documentation for constructors, properties, and methods. Replaced inline comments with `<inheritdoc/>` tags for consistency and maintainability. Added a `Dispose` method and finalizer for resource management.

Updated the `IBsonDataReader` interface with comprehensive XML documentation and remarks to clarify its role in efficient sequential access to query results.
Enhanced XML documentation for `ILiteDatabase` interface, adding detailed descriptions, usage scenarios, and `<remarks>` sections for methods and properties. Refactored `LiteDatabase` class to use `<inheritdoc/>`, centralizing documentation in the interface and reducing redundancy.

Improved parameter and return value descriptions, clarified SQL execution methods, and expanded file storage operation details. Standardized terminology and ensured consistency across the API. Added contextual remarks for key operations like transactions, checkpoints, and rebuilds.
Enhanced the `Pragmas` class with XML documentation for better clarity and maintainability.
…LiteEngine`, to improve clarity and maintainability.
Enhanced XML documentation for the `RebuildOptions` class and its members to improve clarity and maintainability.

- Added detailed summaries and remarks for class properties and methods.
- Clarified the purpose of `_buildId`, `Password`, `Collation`, and `IncludeErrorReport`.
- Expanded `GetErrorReport` documentation with a detailed description of the error report structure and behavior.
- Improved consistency using `<see cref="..."/>`, `<remarks>`, `<list>`, and `<item>` tags.

These changes aim to make the class more self-explanatory and user-friendly for developers configuring database rebuild operations.
Enhanced XML comments for properties and methods in the
`ILiteDatabase` interface to provide additional context,
default values, and usage notes.

- Documented default values for `UserVersion`, `Timeout`,
  `UtcDate`, `LimitSize`, `CheckpointSize`, and `Collation`.
- Clarified behaviors for properties like `LimitSize` and
  `CheckpointSize`.
- Added remarks to `Collation.Default` to explain fallback
  to `CultureInfo.InvariantCulture` when the current culture
  is unsupported.

These changes improve clarity, usability, and consistency
of the `LiteDB` library documentation.
Replaced explicit XML comments with `<inheritdoc/>` across the codebase to reduce redundancy and ensure consistency. Enhanced the `ILiteCollection<T>` interface with detailed documentation, including summaries, parameter explanations, return values, remarks, and examples. Updated the `LiteCollection<T>` class to inherit documentation from the interface.

Added high-level summaries, clarified behavior for query and indexing methods, and standardized return value descriptions. Deprecated the `InsertBulk` method with updated remarks recommending alternative usage. Highlighted ACID compliance for operations and improved clarity for LINQ and BSON expression overloads.

These changes improve code readability, maintainability, and developer experience while ensuring scalability for future updates.
…led XML documentation for all methods, improving developer usability and discoverability. Replaced inline comments in `LiteQueryable<T>` with `<inheritdoc/>` to ensure consistency and maintainability.
…iled `<param>`, `<returns>`, and `<exception>` tags.
Enhanced XML documentation for the `ObjectId` class, including detailed descriptions, parameter explanations, and exception details. Added remarks to clarify the structure and uniqueness of `ObjectId`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant