MicroElements source only package: Reflection. Classes: TypeExtensions, TypeCheck, ObjectExtensions, Expressions, CodeCompiler, FriendlyName.
Get Started
| Product | Versions |
|---|---|
| .NET Standard |
README
MicroElements.Reflection.Sources
Summary
MicroElements source only package: Reflection. Classes: TypeExtensions, TypeCheck, ObjectExtensions, Expressions, CodeCompiler, FriendlyName.
Extensions
FriendlyName
Gets friendly (human readable) name for the type.
Usage
// Without GetFriendlyName
typeof(List<ValueTuple<int?, string>?>).Name.Should().Be("List`1");
typeof(List<ValueTuple<int?, string>?>).FullName.Should().StartWith("System.Collections.Generic.List`1[[System.Nullable`1[[System.ValueTuple`2[[System.Nullable`1[[System.Int32, System.Private.CoreLib");
// With GetFriendlyName
typeof(List<(int Key, string Value)>).GetFriendlyName().Should().Be("List<ValueTuple<int, string>>");
Notes:
- For for standard and primitive types uses aliases:
string, object, bool, byte, char, decimal, double, short, int, long, sbyte, float, ushort, uint, ulong, void. Example:Int32->int. - You can replace standard aliases with
typeAliasesparam - For generic types uses angle brackets:
List'1->List<int> - For array types uses square brackets:
Int32[]->int[] - For
Nullablevalue types adds?at the end - Uses recursion. Example:
List<Tuple<int, string>> - Uses cache: every name builds only once. You can use uncached
BuildFriendlyName. - ThreadSafe: true
Other (Description TBD):
- TypeExtensions
- TypeCheck
- ObjectExtensions
- CodeCompiler
- Expressions
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.