Skip to content

Packages ​

Cocoar.Reflectensions is split into focused packages. Install only what you need.

Core ​

Cocoar.Reflectensions ​

The main library with all core functionality.

bash
dotnet add package Cocoar.Reflectensions
NuGetCocoar.Reflectensions
Targets.NET 8.0, .NET Standard 2.0
DependenciesNone

Includes:

  • TypeHelper — type parsing and resolution from strings
  • Type extensions — IsNumericType(), IsGenericTypeOf(), ImplementsInterface(), etc.
  • Object reflection — Reflect(), To<T>(), TryTo<T>(), As<T>(), property access
  • Method/property/parameter extensions — fluent LINQ-style filtering
  • String extensions — validation, conversion, encoding
  • Enum extensions — GetName(), TryFind()
  • DateTime extensions — Unix time, UTC conversion
  • Array/dictionary extensions — Concat(), SubArray(), Merge()
  • Assembly extensions — embedded resource reading
  • Helpers — Base58Helper, WildcardHelper, Enum<T>, ArrayHelpers

Invoke ​

Cocoar.Reflectensions.Invoke ​

Dynamic method invocation with automatic parameter matching.

bash
dotnet add package Cocoar.Reflectensions.Invoke
NuGetCocoar.Reflectensions.Invoke
Targets.NET 8.0, .NET Standard 2.0
DependenciesCocoar.Reflectensions

Includes:

  • InvokeHelper — invoke methods via MethodInfo
  • Synchronous and asynchronous invocation
  • Generic method invocation with type arguments
  • Automatic parameter type conversion

Expandable Object ​

Cocoar.Reflectensions.ExpandableObject ​

Dynamic objects with dictionary-like behavior.

bash
dotnet add package Cocoar.Reflectensions.ExpandableObject
NuGetCocoar.Reflectensions.ExpandableObject
Targets.NET 8.0, .NET Standard 2.0
DependenciesCocoar.Reflectensions

Includes:

  • ExpandableObject — dynamic object wrapper
  • Initialize from objects, dictionaries, or empty
  • INotifyPropertyChanged support
  • Implicit conversion from Dictionary<string, object?>

Which Package Do I Need? ​

Use casePackage
Type parsing, type checking, type conversionCore
Fluent method/property filteringCore
String validation and conversionCore
Dynamic method invocation via MethodInfoCore + Invoke
Dynamic objects with dictionary behaviorCore + ExpandableObject
EverythingAll three

Compatibility ​

All packages target:

  • .NET 8.0 — recommended for new projects
  • .NET Standard 2.0 — compatible with:
    • .NET Core 2.0+
    • .NET 5+
    • .NET Framework 4.6.1+
    • Mono 5.4+
    • Xamarin.iOS 10.14+
    • Xamarin.Android 8.0+

Released under the Apache-2.0 License.