Questions tagged [fastmember]

Anything related to FastMember library that provides fast access to .net fields/properties

FastMember library provides fast access to .net fields/properties.

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.

FastMember project on git

43 questions
3
votes
2 answers

SqlBulkCopy Cannot insert the value NULL into column

I am trying to Bulkinsert a certain list of custom objects into my database, using the fastmember (Fastmember NuGet) extension and sqlbulkcopy. However it gives me the following error: An unhandled exception of type…
usselite
  • 846
  • 7
  • 24
2
votes
1 answer

Cannot run FastMember based console app

I'm just playing around with FastMember and have hit a problem. Each time I start my console app I get the following exception: Could not load type 'FastMember.ObjectAccessor' from assembly 'FastMember, Version=1.0.0.0, Culture=neutral,…
Jason Evans
  • 28,906
  • 14
  • 90
  • 154
2
votes
0 answers

Is there a way to use FastMember ObjectReader over an expando/dynamic

Is there a way to use FastMember ObjectReader.Create over a list of ExpandoObject. Here is a simple test case that I made to test: using FastMember; using System; using System.Collections.Generic; using System.Data; using System.Dynamic; using…
billybob
  • 2,859
  • 6
  • 35
  • 55
2
votes
1 answer

FastMember ObjectReader Returns 0 results

I am using FastMember Library to convert List of objects to a dataTable but it returns empty object so could anyone help me to resolve this issue List list = new List() { new { Number = 500 } }; DataTable table = new…
Mo Haidar
  • 3,748
  • 6
  • 37
  • 76
2
votes
1 answer

Convert IBindingList to DataTable

So I have an IBindingList which I have as the data source of a DevExpress chart. It is done this way as the chart updates automatically as the data is gathered. But instead of creating a separate DataTable and logging the data within that I'd prefer…
G Short
  • 21
  • 1
2
votes
1 answer

FastMember and ExpandoObject error

I'm not sure if its supported but I'm trying to get fastmember to give me type information for a dynamic ExpandoObject (using the code below) and I get the error: System.NotSupportedException: Specified method is not supported. at…
gmn
  • 4,199
  • 4
  • 24
  • 46
2
votes
2 answers

does FastMember support anonymous types?

I'm using FastMember for an alternative to reflection. In the source, I see there is a unit test for anonymous type support, but I'm getting a NotSupportedException when I attempt to TypeMember.CreateNew() for an anonymous type. Are they not…
pianomanjh
  • 233
  • 1
  • 14
1
vote
3 answers

How to skip indexer properties in FastMember?

I am using FastMember to dynamically read property values of certain types. Something like this: TypeAccessor accessor = TypeAccessor.Create(type); return accessor.GetMembers().Where(m => m.CanRead).Select(m => accessor[item, m.Name]); But I would…
nawfal
  • 70,104
  • 56
  • 326
  • 368
1
vote
1 answer

HyperPropertyDescriptor issue with .net framework 4.5.2

am trying to convert a list of objects to datatable and am using the solution given in this response https://stackoverflow.com/a/5805044/1447718. i downloaded hyperproperty and recompiled it to 4.5.2 and used that in my application. when i execute…
user1447718
  • 669
  • 1
  • 11
  • 23
1
vote
1 answer

How do I Use FastMember to create a reader of an object with child object

We need to SQLBulkCopy a collection that we have. And since we need an IDataReader to use SQLBulkCopy, I tried to use FastMember for that. As I understand, we can use FastMember to create an IDataReader from an IEnumerable. So my code reads- using…
Muds
  • 4,006
  • 5
  • 31
  • 53
1
vote
1 answer

SqlBulkCopy with ObjectReader - Failed to convert parameter value from a String to a Int32

I am using SqlBulkCopy (.NET) with ObjectReader (FastMember) to perform an import from XML based file. I have added the proper column mappings. At certain instances I get an error: Failed to convert parameter value from a String to a Int32. I'd…
Mr767267
  • 1,008
  • 2
  • 11
  • 18
1
vote
0 answers

sqlbulkcopy from a ConcurrentDictionary

I have a ConcurrentDictionary and I am trying to make use of fastmember as per this example by marc but what I have is just an array of Guid not a complex type with properties. So when i use var pastTripsToDelete = new ConcurrentDictionary
Swamy
  • 463
  • 2
  • 9
  • 20
1
vote
1 answer

Can FastMember.ObjectReader take DisplayName into account?

I'm using FastMember.ObjectReader to copy a list of structs to a DataTable, which I then use as the DataSource of a gridview: struct Foo { [DisplayName("title1")] public string Bar { get; set; } } ... var rows = new List(); rows.Add(new…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
1
vote
1 answer

FastMember and nullable properties

i'm having an issue using fastmember, where by i have a public nullable property (datetime) for my class, but when i try and insert it into the db the column value is an empty string an not a null, which causes an exception to be thrown, any ideas…
DanSolo
  • 19
  • 7
1
vote
1 answer

DataTable.Load() Specified argument was out of the range of valid values

I am trying to work with the NuGet Package FastMember to load a List Object into a DataTable object. Following is the code I am using. using System; using System.Collections.Generic; using System.Linq; using System.Text; using…
spyronum
  • 67
  • 2
  • 9