You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lightweight and efficient tool for parsing and managing C# XML documentation comments.
7
7
8
-
A lightweight and efficient tool for parsing, and managing C# XML documentation comments.
9
8
10
-
11
-
### BitzArt.XDoc
9
+
# BitzArt.XDoc
12
10
13
11
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:
14
12
* Types/classes
@@ -28,7 +26,7 @@ var typeDocs = xdoc.Get(typeof(MyType));
Each XDoc instance maintains its own cache of parsed documentation in a `ConcurrentDictionary<Assembly, AssemblyDocumentation>`. Using multiple instances unnecessarily duplicates this data in memory
88
+
89
+
If your application provides documentation-related services (like API documentation generation), maintaining a single pre-loaded XDoc instance can significantly improve response times.
90
+
91
+
### Possible approaches
92
+
93
+
#### Dependency Injection (Recommended)
94
+
Register XDoc as a singleton in your application's dependency injection container.
95
+
96
+
#### Factory
97
+
Create a factory that provides access to a shared XDoc instance:
98
+
99
+
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.
0 commit comments