How can I force a class have a specified constructor signature without using abstract classes? I googled and found that we couldn't use interfaces to do it.
[Updated]
e.g, I have the the following Interface
:
public interface IListView<TViewModel, TListQueryParameter, TSingleQueryParameter>
where TListQueryParameter : IQueryParameter<IEnumerable<TViewModel>>, new()
where TSingleQueryParameter : IQueryParameter<TViewModel>
{
...
IQueryHandler<TListQueryParameter, IEnumerable<TViewModel>> FindListDataQueryHandler { get; }
IQueryHandler<TSingleQueryParameter, TViewModel> FindSingleEntityQueryHandler { get; }
...
}
and I want to inject QueryHandler
s using constructor of each Form
that implement the IListView
.