FastMemberMT 6.0.0

Install-Package FastMemberMT -Version 6.0.0
dotnet add package FastMemberMT --version 6.0.0
<PackageReference Include="FastMemberMT" Version="6.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FastMemberMT --version 6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FastMemberMT, 6.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install FastMemberMT as a Cake Addin
#addin nuget:?package=FastMemberMT&version=6.0.0

// Install FastMemberMT as a Cake Tool
#tool nuget:?package=FastMemberMT&version=6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

FastMemberMT - Fast Memeber Multi Targeted

Fast access to .net fields/properties

It looks like this project has not been updated in a few years, so I cloned it and added netstandard2.1, netcore3.1 and net5.0.

In .NET reflection is slow... well, kinda slow. If you need access to the members of an arbitrary type, with the type and member-names known only at runtime - then it is frankly hard (especially for DLR types). This library makes such access easy and fast.

An introduction to the reasons behind fast-member can be found <a href="http://marcgravell.blogspot.com/2012/01/playing-with-your-member.html" target="_blank">on my blog</a>; example usage is simply:

var accessor = TypeAccessor.Create(type); 
string propName = // something known only at runtime 
while( /* some loop of data */ )
{ 
  accessor[obj, propName] = rowValue; 
}

or

// obj could be static or DLR 
var wrapped = ObjectAccessor.Create(obj);
string propName = // something known only at runtime 
Console.WriteLine(wrapped[propName]);

Ever needed an IDataReader?

This is pretty common if you are doing object-mapping between an object model and ADO.NET concepts such as DataTable or SqlBulkCopy; loading a DataTable (yes, some people still use it) from a sequence of typed objects can now be as easy as:

IEnumerable<SomeType> data = ... 
var table = new DataTable(); 
using(var reader = ObjectReader.Create(data)) 
{ 
  table.Load(reader); 
}

(the Create method offers parameters to control the specific members, if needed)

Or if you want to throw the data into a database as fast as humanly possible:

using(var bcp = new SqlBulkCopy(connection)) 
using(var reader = ObjectReader.Create(data, "Id", "Name", "Description")) 
{ 
  bcp.DestinationTableName = "SomeTable"; 
  bcp.WriteToServer(reader); 
}

Ahead of Time

Library emits IL code during runtime. Will not work in constrained Ahead of Time environments. Xamarin iOS and Unity IL2CPP are such.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FastMemberMT:

Package Downloads
EzSqlBulkTools

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.0 39 11/22/2021
5.0.0 273 8/29/2021

net6.0, .net 5.0, netstandard 2.1, netcore3.1