Free Code: Deferred calls to IDispose

I’ve been dealing with heavy use of Stream types recently. Not as in the fairly common usages of say, reading a text file or whatnot. We’re talking Streams that transform data from one format to the other transparently to the caller, that run across various nodes in a cluster (think a Stream of Streams), that…

0

Free Code: WriteOnlySet<T>

So had a fun business entity that needed a write only set of data that contained no duplicates (involved a security auditing trail if you care to know). That’s when I realized we didn’t have anything like this in the BCL. So here’s a fun little ISet<T> implementation that proxies any existing set to provide…

0

Yes you can execute PARAMETERIZED sprocs with EF Fluent API Code Only (and more!)

This is really an add-on to this post here. Turns out most people were only thinking that you could execute SQL strings only as opposed to detailed parameterized SQL statements. That’s not correct. It’s all supported and approved. Scenario 1. Using Parameterized SQL statements So this covers selects as well as invoking sprocs. If you…

0

Simple WCF netMsmq Example (or Step 1 to stop reinventing yet another MSMQ clone)

It’s pretty obvious that MSMQ is a bit of a dark art out there. People know it exists, everyone knows someone somewhere that knows a guy who once did something with it, and like practitioners of esoteric arts, the technology is looked upon with distrust. In fact to the point that I see team after…

6

Powershell Automation and Remoting (a c# love story)

OK all of you readers out there should know and love Powershell by now and you are using it constantly, right? If not get on with it! One of the most exciting things that came out of version 2 was the ability to perform remoting. Basically the ability to connect a session to a remote…

5

Yes you can execute sprocs with EF Fluent API Code Only

OK let’s make this clear. You can totally call SQL Functions, SQL SPROCS, or any other raw SQL statement and use it in EF Code Only. What you don’t get is automatic or fluent API configuration statements that perform this mapping work for you and by default, no tracking occurs on the materialized objects (though…

1

Map private properties with EF Fluent API

So until we get EF 4.2 and the support for enumerations as first class citizens those of us needing support have resigned ourselves to the simple fact that we are forced to expose a property for the integer value for EF to use and wrap that value with a convenience property that casts it as…

3

Using reflection to determine if an event is static

So if you happen to have an EventInfo class and need to determine if the event is static or instance, it isn’t actually immeidately clear if this is supported. Most of the MemberInfo basic types expose a property named IsStatic that indicates if this member is static or not. If you’ve ever worked with the…

0

Modifying ASP.Net Providers at Runtime

How to add providers at runtime programmatically So if you are like me, you are a fan of not reinventing the wheel. This is especially true of components like Membership, Roles, Authentication, Personalization and whatnot. While I take some issue with the choice of API and can think of many improvements that should be made,…

2

Unit Testing Repositories, a rebuttal. Or "How to use proper decoupling to unit test the repository pattern"

For primers, you need to read this post first: http://buffered.io/2008/07/29/unit-tests-boldly-crossing-boundaries-and-gently-breaking-rules/ So the other day I received an email from a group that I am assisting in understanding TDD, Test Concepts, and Separation of Concerns, and they asked, “Is this relevant”? Well here’s the reply to them. Relevant: Yes and no.There’s some good conversation going on…

0