Suppose I have the following:
using(var ctx = DataContextFactory.Create(0))
{ ... Some code ... }
Why not just do the following and lose a couple of curly braces?:
var ctx = DataContextFactory.Create(0);
ctx.Dispose();
Thanks for the advice!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…