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
1
vote
1 answer

ISO-1 C# language specification error for FastMember

I loaded up the .net 3.5 FastMember from http://code.google.com/p/fast-member/source/checkout in VS 2010. The compiler generates this error: feature 'static classes' cannot be used because it is not part of the ISO-1 C# language specification. How…
sgtz
  • 8,849
  • 9
  • 51
  • 91
0
votes
1 answer

FastMember convert datagridview CurrentRow back to Objectt

I used this code to convert IEnumerable to Datatable, in order to use extended functionality in one datagridview. DataTable table = new DataTable(); using (var reader = ObjectReader.Create(data)) { table.Load(reader); } Now I need to…
miguelmpn
  • 1,859
  • 1
  • 19
  • 25
0
votes
0 answers

DataTable.Load() Turns Enum Into Integer

I'm using SqlBulkCopy to insert some data into a table. My data object has an enum property. I want to save it as the value (G), not an int (1). At the point where I call dataTable.Load(), the property goes from a 'G' to a 1. Apparently that's just…
Bob Horn
  • 33,387
  • 34
  • 113
  • 219
0
votes
1 answer

Copy properties recursively with FastMember

I have two objects from this class: public class A { public int Id { get; set; } public string Name { get; set; } public IList Bs { get; set; } } public class B { public string Description { get; set; } public IList Cs {…
Raphael
  • 107
  • 1
  • 9
0
votes
1 answer

Get values out of collections with FastMember

I use FastMember to get values out of objects and nested objects. If a property is a string or int everything works fine. But now I want to get the values also for collections. Here is my code so far: // Set accessor var sourceAccessor =…
Raphael
  • 107
  • 1
  • 9
0
votes
1 answer

Argument out of range exception, Parameter name : name

Each time trying to execute the following code with different rows; getting the same exception : var result = (from prod in context.ProductsTbls join img in context.ProductImagesTbls on prod.Id…
0
votes
1 answer

Check whether property is readonly

I have this code using reflection and I decided to replace it by FastMember. This is my code: var VehicleType = TypeAccessor.Create(res.GetType()); var vehicleFastMember = ObjectAccessor.Create(res); foreach (var kvp in dictionary) { if…
user8620575
  • 165
  • 2
  • 9
0
votes
1 answer

Trying to map a .NET string[] to a FastMember object but it's erroring/not mapping

I'm trying to insert a list of file names into a simple Sql Server table. I'm trying to leverage SqlBulkCopy and @markgravell's FastMember library, as suggested by other SO answers. public async Task AddFileNamesAsync(string[] fileNames) { …
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
0
votes
1 answer

Trouble Deserializing JSON to DataTable

I'm new to C# and I am working on deserializing a JSON response from an API and resending the reponse to a DataTable (and then to SQL Server). I'm using JSON.NET and RestSharp. I followed the answer that was outlined here Convert Json String to C#…
0
votes
2 answers

Using Fastmember to bulk insert only selected columns

I have an application that is being used to insert large amounts of data (up to about 250,000 records per file) from a file to a table that has several computed columns. Is there any way to select which columns fastmember inserts the data so I don't…
crunchy
  • 705
  • 1
  • 13
  • 35
0
votes
0 answers

BulkCopy List using FastMember

I've done BulkCopy of List using FastMember and Threading for faster Performance. Actually,I need to bulkcopy like 999999999 records and I've made an interval for every 1000000 records and Clearing the List to avoid OutofMemory Exception. The…
RealSteel
  • 1,871
  • 3
  • 37
  • 74
0
votes
1 answer

Use emit to return null

I've been using the FastMember project. It contains this code: il.Emit(OpCodes.Ldarg, 2); il.Emit(OpCodes.Newobj, typeof(ArgumentOutOfRangeException).GetConstructor(new[] { typeof(string) })); il.Emit(OpCodes.Throw); I would like to change that to…
Brannon
  • 5,324
  • 4
  • 35
  • 83
-2
votes
1 answer

Discarding "Anonymous" exception while joining tables

I got confused, how to join for example two tables without getting the "Anonymous" exception; for example the following code fraction: var result = (from prod in context.ProductsTbls join imag in…
1 2
3