c# - Does my UoW class need to implement IDisposable if my BaseUow already implements it? -


i have created base class unit of work called baseuow inherits idisposable so:

public class baseuow : idisposable { } 

my question is... if create class called useruow example inherits baseuow useruow need implement idisposable or handled baseuow

public class baseuow : ibaseuow { } 

or

public class baseuow : ibaseuow, idisposable { } 

ibaseuow

public interface ibaseuow {     virtual void dispose(bool disposing);     void commit(); } 

you don't need add class declaration, unless want make explicit readability.

however, may need, add protected virtual void dispose(bool disposing){ method override perform child class' clean tasks if there any.

see here more information on proper pattern follow.

edit: pointed out in comments, if extending base baseuow class. because "pictures" show implementing other interface, not extending base class in question.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -