BitzArt.XDoc.PlainText 1.0.10-rc

Prefix Reserved
This is a prerelease version of BitzArt.XDoc.PlainText.
dotnet add package BitzArt.XDoc.PlainText --version 1.0.10-rc
                    
NuGet\Install-Package BitzArt.XDoc.PlainText -Version 1.0.10-rc
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BitzArt.XDoc.PlainText" Version="1.0.10-rc" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BitzArt.XDoc.PlainText" Version="1.0.10-rc" />
                    
Directory.Packages.props
<PackageReference Include="BitzArt.XDoc.PlainText" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BitzArt.XDoc.PlainText --version 1.0.10-rc
                    
#r "nuget: BitzArt.XDoc.PlainText, 1.0.10-rc"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BitzArt.XDoc.PlainText@1.0.10-rc
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BitzArt.XDoc.PlainText&version=1.0.10-rc&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BitzArt.XDoc.PlainText&version=1.0.10-rc&prerelease
                    
Install as a Cake Tool

Tests

NuGet version NuGet downloads

A lightweight and efficient tool for parsing and managing C# XML documentation comments.

BitzArt.XDoc

BitzArt.XDoc is a lightweight .NET library for parsing and accessing XML documentation comments from your C# code. It provides an intuitive API to retrieve documentation for:

  • Types/classes
  • Properties
  • Methods
  • Fields

using BitzArt.XDoc;
...

var xdoc = new XDoc();

var typeDocs = xdoc.Get(typeof(MyType));
var propertyDocs = xDoc.Get(typeof(MyType).GetProperty(nameof(MyType.PropertyOne)));

BitzArt.XDoc.PlainText

BitzArt.XDoc.PlainText is an extension package for BitzArt.XDoc that enables rendering XML documentation comments into plain text.


using BitzArt.XDoc;
using Xdoc.Renderer.PlaintText;

...
    
var xdoc = new XDoc();

var typeDescrption = xDoc.Get(typeof(MyType)).ToPlainText();
var propertyDescrption = xDoc.Get(typeof(MyType).GetProperty(nameof(MyType.PropertyOne))).ToPlainText();

BitzArt.XDoc.EntityFrameworkCore

BitzArt.XDoc.EntityFrameworkCore is an extension library that bridges XML documentation comments from C# code to Entity Framework Core database objects.

Example 1: Configure comments for all entities in your DbContext

using BitzArt.XDoc;

public class MyDbContext : DbContext 
{
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        
        // Configure comments for all entities
        modelBuilder.ConfigureComments(new XDoc());
    }
}

Example 2: Configure comments for specific properties using Fluent API

using BitzArt.XDoc;

...

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<Customer>()
        .Property(c => c.Name)
        .HasComment<string, Customer>(c => c.Name);
}

Recommendations

Each XDoc instance maintains its own cache of parsed documentation in a ConcurrentDictionary<Assembly, AssemblyDocumentation>. Using multiple instances unnecessarily duplicates this data in memory

If your application provides documentation-related services (like API documentation generation), maintaining a single pre-loaded XDoc instance can significantly improve response times.

Possible approaches

Register XDoc as a singleton in your application's dependency injection container.

Factory

Create a factory that provides access to a shared XDoc instance:

By following these recommendations, you can ensure that XML documentation is parsed only once per assembly, maximizing performance and minimizing resource usage in your application.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on BitzArt.XDoc.PlainText:

Package Downloads
BitzArt.XDoc.EntityFrameworkCore

Extension library that bridges XML documentation comments from C# code to Entity Framework Core database objects.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.10-rc 245 7/7/2025
1.0.9-rc 172 7/3/2025
1.0.8-rc 170 7/2/2025
1.0.7-rc 136 6/22/2025
1.0.6-rc 1,134 6/9/2025
1.0.5-rc 485 4/22/2025
1.0.4-rc 229 4/16/2025
1.0.3-rc 216 4/15/2025
1.0.2-rc 233 4/14/2025
1.0.1-rc 218 4/14/2025
1.0.0-rc 204 4/9/2025
0.1.9-prerelease 187 4/2/2025
0.1.8-prerelease 176 4/1/2025
0.1.7-prerelease 183 3/30/2025
0.1.6-prerelease 175 3/20/2025
0.1.5-prerelease 183 3/19/2025
0.1.4-prerelease 181 3/19/2025
0.1.2-prerelease 181 3/19/2025
0.1.1-prerelease 181 3/19/2025
0.1.0-prerelease 188 3/12/2025
Loading failed