KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is it equivalent? public static void Using<T>(this T disposable, Action<T> action) where T:IDisposable { try { action(disposable); } finally { disposable.Dispose(); } } new SqlConnection("").Using(conn => { }); using(var conn = new SqlConnection("")){ }; in other words, can we replace using keyword with this method?
Tags (comma-separated)
Save Edits
Cancel