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 using
it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With