Dave Glick (Page 14)

A Simple ConcurrentHashSet Implementation

I really like the classes in the System.Collections.Concurrent namespace. They have clean APIs, they implement the appropriate interfaces, and they make working with collections from multiple threads much, much easier. That said, there's one collection I find myself reaching for repeatedly that isn't available in the set of concurrent collections: a hash set. I have no idea why this was omitted, but I decided to go ahead and create a simple implementation myself.

Read more...

Computed Properties and Entity Framework (Revisited)

Another way to use your computed properties in predicates and projections.

Since publishing my first post on the topic over a year ago, I've continued to look for easy ways to tackle this problem. In the last post, I ended up recommending the excellent DelegateDecompiler library to help convert plain unmapped properties to expression trees that LINQ to Entities can use. I still like this approach, but I've also been searching for a way to make this process a little more transparent and use a little less magic.

Read more...

NuGet API Survey

What projects are using the NuGet API?

By now, most .NET developers are at least a bit familiar with NuGet, the NuGet command line interface, and the NuGet GUI in Visual Studio. But did you know there's another way to use NuGet? The project has published libraries (on NuGet, how meta!) for a while. You can reference these libraries from your own code to make your application create packages, download them, extract them, etc. In NuGet version 2, most of the surface API was contained in a library called NuGet.Core. However, the move to NuGet version 3 is bringing some big changes including a transition to many smaller and more granular API libraries. I use the NuGet APIs in some of my own projects and I was wondering how many other projects use them and in what ways. There isn't a lot of documentation on the APIs, so looking at other code is one of the best ways to figure out what works and what doesn't. I was also hopeful it might give me some clues to the future of the NuGet APIs and how best to transition to version 3.

Read more...