I have the following:
public class Query : IAsyncRequest<Envelope<Reply>> { }
public class Reply { }
public class Flow<TQuery, TReply> where TQuery: IAsyncRequest<Envelope<TReply>>, IRequest<Envelope<TReply>> {
public TQuery Query { get; set; }
public TReply Reply { get; set; }
public Flow(TQuery query, TReply reply) {
Query = query;
Reply = reply;
}
}
When I try to create an instance of Flow as
Query query = service.GetQuery();
Reply reply = service.GetReply();
Flow flow = new Flow(query, reply);
I get the error:
Using the generic type 'Flow<TQuery, TReply>' requires 2 type arguments
Can't I create a Flow this way?