Suppose I have the following:
using(var ctx = DataContextFactory.Create(0)) { ... Some code ... }
Why not just do the following and lose a
The first is better. It ensures it is disposed even if an exception is thrown, and it correctly handles the case where Create(0) returns null (i.e. it doesn't attempt to call Dispose() on a null instance).
Create(0)
Dispose()