Answer the question
In order to leave comments, you need to log in
Is it possible to somehow more conveniently implement the default method call in interfaces?
I have an interface
public interface IEvent<Handler, Arguments> where Handler : IHandler<Handler, Arguments>
{
public void Create(Arguments arguments)
{
/////
}
}
(this as IEvent<Handler, Argument>).Create(argument);
Create<Handler, Argument>.Create(argument)
Answer the question
In order to leave comments, you need to log in
without castes
private IEvent<Handler, Argument> thisEvent => this;
// ...
thisEvent.Create(argument);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question