domain driven design - How to handle two or more domainevents in c#? -
in c# have scenario in @ least 2 places different domain events raised , want single hander handle them same code (other listeners may perform event specific code). handlers using following pattern;
public class somehandler : ihandler<someevent> { public somehandler() { //whatever init code } public void handle(someargs args) { //common code } }
so best way handle more 1 event same handler? thanks
ihandler<someevent>
interface perhaps can implement multiple ones:
public class somehandler : ihandler<someevent>, ihandler<someotherevent> { public somehandler() { //whatever init code } public void handle(someargs args) { //common code } public void handle(someotherargs args) { //common code } }
Comments
Post a Comment