Mastronardi.Utils.Reflection 1.1.11

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Mastronardi.Utils.Reflection --version 1.1.11
NuGet\Install-Package Mastronardi.Utils.Reflection -Version 1.1.11
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="Mastronardi.Utils.Reflection" Version="1.1.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mastronardi.Utils.Reflection --version 1.1.11
#r "nuget: Mastronardi.Utils.Reflection, 1.1.11"
#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 Mastronardi.Utils.Reflection as a Cake Addin
#addin nuget:?package=Mastronardi.Utils.Reflection&version=1.1.11

// Install Mastronardi.Utils.Reflection as a Cake Tool
#tool nuget:?package=Mastronardi.Utils.Reflection&version=1.1.11

Reflection Utils

Fast Activator

The normal instance activator is not fast, period. So here comes the fast activator:

var myObject = (MyObject)FastActivator.CreateInstance(typeof(MyObject));

This was for objects with a default constructor, for objects with parameters in the constructor you can do this:

var myObject = (MyObject)FastActivator<T1, T2, T3>.CreateInstance(typeof(MyObject));

T1 to T3 are the types of your arguments. For now only three arguments are available.

Fast Delegate

When you want to use reflection to get or set a property it is slow. Why not create a delegate for it?

PropertyInfo.BindGet();

or for setting:

PropertyInfo.BindSet();

it will return a delegate you can reuse in your application.

For Methods you can do it ike this

var method = MethodInfo.Bind();

It will give you the method delegate to keep calling the method in a fast manner.

Static functions

You can use the Functions.GetValue method to get the value of an object by its string property name, it caches the reflection side for you.

Extension Methods

On an Enum you can do GetAttributeOfType to get a specific attribute from the Enum in a fast way.

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 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 is compatible.  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 (4)

Showing the top 4 NuGet packages that depend on Mastronardi.Utils.Reflection:

Package Downloads
Mastronardi.Utils.Serialization The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

The Serialization Utils help with serializeing to and from Base64, Binary, Xml, ...

Mastronardi.Utils.Web The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

The Web utils help working with HTML, cleaning HTML, Parsing it, Parsing CSS, Embedding images, Querystring handling

Mastronardi.Utils.Validation The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

The Validation utils help you validate input, like a number or email...

Mastronardi.Utils.Azure.Functions The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A library containing extra useful extensions for Azure Functions

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.11 481 5/13/2023
1.1.10 783 10/10/2022
1.0.0 395 8/28/2023