I’ve got some code that looks like this:
using (DBDataContext dc = new DBDataContext(ConnectionString)) { Main main = new Main { ClientTime = clientTime }; dc.Mains.InsertOnSubmit(main); dc.SubmitChanges(); return main.ID; }
If I return from inside a ‘using’, will the using still clean up?
Yes, and that’s one of the big advantages of
usingit.