FlashReflection 1.0.2

dotnet add package FlashReflection --version 1.0.2                
NuGet\Install-Package FlashReflection -Version 1.0.2                
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="FlashReflection" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FlashReflection --version 1.0.2                
#r "nuget: FlashReflection, 1.0.2"                
#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.
// Install FlashReflection as a Cake Addin
#addin nuget:?package=FlashReflection&version=1.0.2

// Install FlashReflection as a Cake Tool
#tool nuget:?package=FlashReflection&version=1.0.2                

FlashReflection - .NET reflection in a flash

Travis build status AppVeyor build status

FlashReflection is a faster and easier way to use reflection in .NET. This library provides cache of types, properties, attributes and methods. It allows a much faster access to property values.

How to use:

var classAReflected = ReflectionCache.Instance.GetReflectionType<ClassA>();
var valueOfProperty = classAReflected.Properties["Name"].GetValue(objectOfClassA);

Cache options can be set globally by doing the following before any call to ReflectionCache.Instance

ReflectionCache.ReflectionCache = new MemoryCacheOptions();

When using ReflectionCache.Instance.GetReflectionType<ClassA> you can specify its cache entry options as well.

ReflectionCache.Instance.GetReflectionType<ClassA>(new MemoryCacheEntryOptions());

Benchmark

<pre> Method | Mean | Error | StdDev | Scaled| ScaledSD | ------------------------------ |--------------:|----------:|----------:|------:|---------:| GetViaProperty | 0.0058 ns | 0.0091 ns | 0.0085 ns | ?| ? | GetViaDelegate | 1.8663 ns | 0.0119 ns | 0.0112 ns | ?| ? | GetViaILEmit | 2.9481 ns | 0.0174 ns | 0.0154 ns | ?| ? | GetViaCompiledExpressionTrees | 11.2914 ns | 0.0271 ns | 0.0254 ns | ?| ? | GetViaFastMember | 33.8724 ns | 0.0973 ns | 0.0910 ns | ?| ? | <b>GetViaFlashReflection</b> | <b>6.4690 ns</b> | <b>0.0160 ns</b> | <b>0.0142 ns</b> | ?| ? | GetViaReflectionWithCaching | 126.4189 ns | 0.2890 ns | 0.2703 ns | ?| ? | GetViaReflection | 192.1511 ns | 0.3489 ns | 0.3264 ns | ?| ? | GetViaDelegateDynamicInvoke | 954.5050 ns | 9.3122 ns | 8.7107 ns | ?| ? | SetViaProperty | 1.8824 ns | 0.0102 ns | 0.0091 ns | ?| ? | SetViaDelegate | 9.3983 ns | 0.0167 ns | 0.0157 ns | ?| ? | SetViaILEmit | 10.3386 ns | 0.0643 ns | 0.0601 ns | ?| ? | SetViaCompiledExpressionTrees | 9.9524 ns | 0.0418 ns | 0.0391 ns | ?| ? | SetViaFastMember | 35.6829 ns | 0.1239 ns | 0.1159 ns | ?| ? | <b>SetViaFlashReflection</b> | <b>6.7196 ns</b> | <b>0.0153 ns</b> | <b>0.0136 ns</b> | ?| ? | SetViaReflectionWithCaching | 205.2057 ns | 0.9305 ns | 0.8704 ns | ?| ? | SetViaReflection | 277.5734 ns | 1.9667 ns | 1.8396 ns | ?| ? | SetViaDelegateDynamicInvoke | 1,010.4607 ns | 8.6607 ns | 8.1012 ns | ?| ? | </pre>

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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. 
.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 was computed. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 18,802 11/23/2017
1.0.1 1,021 10/17/2017
1.0.0 1,142 10/2/2017

Added ObjectExtensions