JJ.Framework.Reflection.Legacy
0.250.4511
Prefix Reserved
See the version list below for details.
dotnet add package JJ.Framework.Reflection.Legacy --version 0.250.4511
NuGet\Install-Package JJ.Framework.Reflection.Legacy -Version 0.250.4511
<PackageReference Include="JJ.Framework.Reflection.Legacy" Version="0.250.4511" />
<PackageVersion Include="JJ.Framework.Reflection.Legacy" Version="0.250.4511" />
<PackageReference Include="JJ.Framework.Reflection.Legacy" />
paket add JJ.Framework.Reflection.Legacy --version 0.250.4511
#r "nuget: JJ.Framework.Reflection.Legacy, 0.250.4511"
#:package JJ.Framework.Reflection.Legacy@0.250.4511
#addin nuget:?package=JJ.Framework.Reflection.Legacy&version=0.250.4511
#tool nuget:?package=JJ.Framework.Reflection.Legacy&version=0.250.4511
JJ.Framework.Reflection.Legacy
Extensions to the System.Reflection and System.Linq.Expressions namespaces. Work with expressions and reflection. Turn lambdas into text:
"myParam.MyList[i].MyProperty"
Extract structured method call data:
{ "MyMethod", Parameters = { "myParameter", int, 3 } }
Find types and implementations for plug-ins. Access private members with Accessors. Use ReflectionCache for fast access to properties, fields, methods and indexers. Includes helpers like IsIndexer, IsStatic and more!
ExpressionHelper
Converts many types of lambda expressions into text or retrieves its resulting value. Here are some of the things it can do:
For instance:
GetText(() => myParam.MyProperty.MyList[i].MySomething)
Will return the string:
"myParam.MyProperty.MyList[i].MySomething"
Similarly you can retrieve its value:
GetValue(() => myParam.MyProperty.MyList[i].MySomething)
which can return:
3
It can also give you method info, parameter names and parameter value info from lambda expressions.
For instance:
GetMethodCallInfo(() => MyMethod(3));
Will return:
MethodCallInfo
{
Name = "MyMethod",
Parameters =
{
ParameterType = typeof(int),
Name = "myParameter",
Value = 3
}
};
Accessor
Allows easy access to the internal, private or protected elements of an assembly or class.
For instance if you have the following private method in a class:
class MyClass
{
private int Private => 3;
}
You can run that private method, that would otherwise not be available:
var obj = new MyClass();
var acc = new MyAccessor(obj);
int num = acc.Private;
You can do that by writing the following wrapper class:
class MyAccessor(MyClass myObject)
{
Accessor _accessor = new(myObject);
public int Private
=> _accessor.GetPropertyValue(() => Private);
}
Limitations
Accessor may suffice for most use cases, but there are some cases where it might be an idea to use System.Reflection directly or PrivateObject and PrivateType from a test framework you might use. Those may have slightly more complex syntax, but may offer a diversion where this Accessor class might not be able to help you.
ReflectionCache
Makes using reflection much faster in certain cases. For instance the GetProperties method can be expensive, which is much faster through the ReflectionCache class.
Example:
private static readonly ReflectionCache _reflectionCache
= new ReflectionCache(BindingFlags.Public | BindingFlags.Instance);
PropertyInfo[] properties
= _reflectionCache.GetProperties(typeof(MyClass));
You can also get other types of constructs in a fast way:
MethodsIndexersFieldsConstructorGetTypeByShortName
In this version, some of the options may only be available in the StaticReflectionCache variant. That variant may perform slightly less fast.
Reflection Helpers
Various helper methods, but one of the most useful features is the GetImplementation method and variations thereof, which allow you to retrieve implementations of a specified base class or interface from an assembly, which is useful for plug-in development.
GetImplementations- Allows you to retrieve implementations of a specified base class or interface from an assembly, which is useful for plug-in development.
GetItemType- Gets the item type of a collection type.
IsIndexerMethod- Can tell you if a
MethodInfopoints to an indexer property.
- Can tell you if a
IsStatic- Can tell you if a
MemberInfois static.
- Can tell you if a
IsNullableType- Returns
trueif the given type is a value type that allowsnull, likeint?orNullable<bool>.
- Returns
GetUnderlyingNullableType- Slightly faster than
Nullable.GetUnderlyingType.
- Slightly faster than
TypesFromObjects- You can pass objects to it, and it will return the concrete types of those objects, with some tolerance for nulls.
IsAssignableFrom/IsAssignableTo- Similar to the original
Type.IsAssignableFrom, but now also anIsAssignableTovariation, if you find that more intuitive.
- Similar to the original
💬 Feedback
Found an issue? Let me know.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- JJ.Framework.Common.Legacy (>= 0.250.4511)
- JJ.Framework.PlatformCompatibility.Legacy (>= 0.250.4511)
-
.NETStandard 2.1
- JJ.Framework.Common.Legacy (>= 0.250.4511)
- JJ.Framework.PlatformCompatibility.Legacy (>= 0.250.4511)
-
net10.0
- JJ.Framework.Common.Legacy (>= 0.250.4511)
- JJ.Framework.PlatformCompatibility.Legacy (>= 0.250.4511)
-
net6.0
- JJ.Framework.Common.Legacy (>= 0.250.4511)
- JJ.Framework.PlatformCompatibility.Legacy (>= 0.250.4511)
-
net7.0
- JJ.Framework.Common.Legacy (>= 0.250.4511)
- JJ.Framework.PlatformCompatibility.Legacy (>= 0.250.4511)
-
net8.0
- JJ.Framework.Common.Legacy (>= 0.250.4511)
- JJ.Framework.PlatformCompatibility.Legacy (>= 0.250.4511)
-
net9.0
- JJ.Framework.Common.Legacy (>= 0.250.4511)
- JJ.Framework.PlatformCompatibility.Legacy (>= 0.250.4511)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on JJ.Framework.Reflection.Legacy:
| Package | Downloads |
|---|---|
|
JJ.Framework.Business.Legacy
Helpers for business logic. Use ISideEffect to separate business logic units. EntityStatusManager is a container for dirty/new/deleted flags and there is a check if a list is dirty. |
|
|
JJ.Framework.IO.Legacy
Lightweight IO utilities | CsvReader | string/stream/byte[] conversions | reading/writing structs to streams |
|
|
JJ.Framework.Validation.Legacy
Home-brewed rudimentary library for validation with a neat fluent notation. Published for legacy purposes. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.253.6073 | 0 | 4/8/2026 |
| 0.252.6001 | 138 | 4/4/2026 |
| 0.251.5729 | 221 | 3/16/2026 |
| 0.251.5705 | 202 | 3/15/2026 |
| 0.250.5600 | 165 | 3/13/2026 |
| 0.250.5203 | 172 | 2/26/2026 |
| 0.250.4991 | 145 | 2/23/2026 |
| 0.250.4987 | 130 | 2/23/2026 |
| 0.250.4821 | 94 | 2/17/2026 |
| 0.250.4554 | 633 | 2/1/2026 |
| 0.250.4542 | 126 | 1/31/2026 |
| 0.250.4531 | 136 | 1/31/2026 |
| 0.250.4511 | 101 | 1/31/2026 |
| 0.250.4474 | 141 | 1/28/2026 |
| 0.250.4463 | 116 | 1/27/2026 |
| 0.250.4415 | 132 | 1/25/2026 |
| 0.250.4205 | 724 | 7/21/2025 |
| 0.250.3304 | 149 | 7/5/2025 |
| 0.250.3301 | 153 | 7/5/2025 |