1

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<int, Guid>();
var uniqueTripID = Guid.NewGuid();
pastTripsToDelete.AddOrUpdate(1, uniqueTripID, (key, oldValue) => uniqueTripID);

using(var bcp = new SqlBulkCopy(connection))
using(var reader = ObjectReader.Create(pastTripsToDelete.Values))
{
    bcp.DestinationTableName = "SomeTable";
    bcp.WriteToServer(reader);
}

I receive "Specified argument was out of the range of valid values", I guess it is looking for properties to map it to the columns in the table but I do not have any as it is a simple array of Guids.

Community
  • 1
  • 1
Swamy
  • 463
  • 2
  • 9
  • 20
  • don't guess see on call stack on which line this is happening. – mybirthname Oct 03 '16 at 14:56
  • It is happening on bcp.WriteToServer(reader) and stack trace shows it on FastMember_dynamic.Guid_1.get_Item(Object , String ). the actual message is Specified argument was out of the range of valid values. Parameter name: name – Swamy Oct 03 '16 at 15:00

0 Answers0