Daily Archives: December 10, 2009

A message from your sponsor: Single and SingleOrDefault are supported in EF4

Just a friendly reminder that I’m passing on from one of the tech reviewers of my book who (thankfully) noticed that I had left a note in there about Single & SingleOrDefault not being supported.

They were not in .NET 3.5 SP1 Entity Framework, but they are now supported in EF4.

Single is the way to go when you only expect one item to be in your result set.

As noted by many, the benefit of Single is highlighted in testing. Single expects only one item to be in the result set. If there are more, then an exception is thrown and this can help you discover logic errors in your application.

For a list of supported & unsupported LINQ methods used (or not used) in LINQ to ENtities, see the MSDN Topic: Supported and Unsupported LINQ Methods (LINQ to Entities)

Sampson the Draft Dog

Sampson has been happily wearing a back pack for months now when we go on hikes.

fall hike 023

It’s a Ruffwear Palisades pack. We love this pack. The packs are removable and what’s left is a decent, comfy, well-fitting harness.

W’e’ve known for a while that Sampson is a good candidate for doing draft work. We don’t have the proper harness yet, but for his first pulling, the back pack harness was sufficient.

We just had a wicked storm and the wind was blowing very hard for over 24 hours. There were a lot of trees down along the trail in our woods. THat won’t do since soon we’ll be skiing back there and until then this is where we walk the dog.

Here’s one spot where there were over 6 trees down. Many of them came up by their roots. That’s what you’re seeing with the arrows on the right – root beds.The ones on the left are across the trail. As usual, it was a friggin poplar that came down but took a nice spruce and another tree along with it.

binghamton and trail work at home 008 (Small)

About 20 feet up the trail were two more big trees across the trail.

Sampson and down trees

Rich needed to bring his chainsaw and other tools back there. Finally he has a little assistance!

first time puling

Sampson didn’t mind it a bit. He barely seemed to notice. He’s a natural!

samspon ready to go

On the way back, I was the brake-man, using an extra bungee cord to be sure the sled didn’t slide right into our baby’s behind.

Just a caveat about the sled, rope, harness setup. This is far from optimal. The rope was rubbing against his sides a bit but it was a short walk in the woods today.

The proper drafting harness protects the dog much more and the weight attaches behind him. Here’s an example: http://alpineoutfitters.net/Secure/Scripts/prodView.asp?idproduct=18. We actually have a harness that says it’s X-L and it is much too small so we have to get another.