I'm trying to fix some code issues suggested by NDepend, in order to get super-sweet high quality code ( at least, that's what I'm striving for ). As it turns out, I hadn't implemented IDisposable on two classes that are using Memcache.
NDepend pointed that out for me, so I made them implement IDisposable. I always google 'basic dispose pattern' to make sure I do it correctly but I always forget why you have to do it the way it's described on this page.
Here's why the Dispose() method calls another Dispose method in the pattern:
More information here: https://msdn.microsoft.com/en-us/library/b1yfkh5e(v=vs.110).aspx#basic_pattern
And of course - there's a whole course about it on PluralSight: http://www.pluralsight.com/courses/idisposable-best-practices-csharp-developers
No comments:
Post a Comment