Archives
-
How to do reflection with a dynamic style
I’m not advocating *private* reflection (invoking private/internal fields, properties and methods), but we all know that there are those corner cases where you just can’t avoid it. And there’s a whole lot of scenarios when there are legitimate uses of reflection itself that can also leverage this very cool dynamic syntax (i.e. invoking generic methods where you don’t know the type at compile-time, etc.). In these cases, your code goes from pristine-looking C# to crappy unreadable reflection code.
-
Building NuGet extensions in 10 minutes, or how to contribute to NETFx
From the documentation:
-
Introducing NETFx, or the end of Common.dll and Helpers.dll
From the project home page:
-
Querying WCF endpoints using Web API
In previous versions of the Web API, you could query your REST endpoints that exposed an IQueryable<T> server-side, kinda “Linq to WCF” as @gblock said. This was immensely useful and an important driver (among others) for me to move away from
AstoriaADO.NET Data Services. That functionality is gone now (vote to get it back!). -
How to easily test WCF Web Api services
Given the many cross-cutting concerns you can cover using the new Web API pipeline, it’s not a bad idea to have a bunch of integration-style tests that cover the actual running service end to end.
-
Using Json.NET for text and binary Json payloads with WCF WebApi
There is an aging post by Christian on how to use the awesome Json.NET library as a default serializer for the new WCF Web Api.
-
How to use Autofac with WCF Web API
The new configuration model in the latest WCF Web APIs allows extending the service instantiation via what is called a resource factory.
-
How to replace default interface property implementation expansion with automatic properties
By default, when you implement an interface in a class, you get the following for properties:
-
Writing inline MSBuild tasks in C# for one-liners
Every now and then, when trying to do something in MSBuild, I hit a roadblock (or maybe just some unintuitive “feature”) and I’m left thinking “gosh, now I have to create a custom MSBuild task for this one-liner that is SO trivial in plain C#!”.
-
DevEnvDir considered harmful
It’s quite common to refer to $(DevEnvDir) in a project, such as to specify the path to a referenced assembly, or to execute a tool on a build event or a target. It’s right there in the UI after all, why not use it?
-
How extension methods ruined unit testing and OOP, and a way forward
You probably know I’m an advocate of a particular way of doing extension methods that I call the “Extension Method Entry Point Pattern”, which makes it easier to mock them.
-
How to design a unit testable domain model with Entity Framework Code First
I got this question a couple times already so I’ll save keystrokes and post here.