I have an application (A1) which is divided into multiple tiers. Some tiers are used for user interactions, some are used to interact with different databases and some included the business logic. We have another third party application (A2) which sends a request to (A1) and A1 needs to response against the request. Below is the architecture of A1.
T3 (This tier receives the request from A2 application)
T2 (Business logic)
T1 (User Interface)
T2 contains all the business logic. The problem I am facing is when I receive request from the A2 application. I need to respond against request on the basis of some business logic which presents in T2. I can invoke the event from T3 that is subscribed by T2 but I have to get data from the event handler like below;
T3:
public Response CanStore(string materialType){
//Invoke event and wait to get response from T2
return response.;
}
T2: Subscribed the event of T3
public async void canStore(object sender, EventArgs e){
//Perform some logic and response result to T3
}
Is it possible?