Tagged with c#

C#, Consuming anonymous types at a later point

Last night I was dealing with anonymous types and some IL code to creating and assigning values to instances of anonymous types. I stumbled upon this question: How do I declare a Field with Anonymous Type (C#) – http://stackoverflow.com/questions/964334/how-do-i-declare-a-field-with-anonymous-type-c It didn’t have anything to do with what I was doing but the thing I was … Continue reading »

C#, Parallel deserialization of JSON stored in database

The scenario A while back ago I had to yield entities constructed by deserializing JSON stored in a database. The first solution just opened a simple single result, sequential reader against the database returning a one column result set containing JSON. This was just yield returned after deserialized to the desired entity. Trying to tweak … Continue reading »

Ensure.That – a simple guard clause project

Yes I know there’s a bunch of these projects out there already and that there’s built in support for using code-contracts in .Net, but even so we found a need for a custom API, hence Ensure.That was created. Also, I think Microsoft’s Code-contracts fails on the part of having to install an add-on to VS2010 … Continue reading »

C# – Custom datareader for SqlBulkCopy

When prototyping SisoDb I used datatables under the covers when consuming the SqlBulkCopy class to insert data. This lead to that I had the source entities in memory as well as the datatables. Since the SqlBulkCopy class can work with readers I created a very simple datareader implementation over my entities instead. I gained a … Continue reading »