C
C#9mo ago
Kuno

How to bind REST API and business logic ?

Hello, I have a console app (core application), which is simulating ground traffic in aerodrome, but besides I have to get a requests from other services (like "May aircraft A23 take off?") and send the changes(like "aircraft A23 has landed on runway 53") to the other APIs. i don't understand the following : 1) how to implement sending messages, does it have to be inside business logic or like a separate module? 2) how to bind REST API and my core app (to change the state of my aerodrome for example, like in example above) 3) how to launch all of them simultaneously ?
5 Replies
Lisa
Lisa9mo ago
1) Generally you will create a service for each other API you are interacting with. These services contain the methods for interacting with the API. 2) I'm not sure I understand the question 3) For launching multiple at the same time you can create several projects under a solution. You can even create a common project to share models and such. Then, in your launch settings you can specify you want to launch specific projects.
Kuno
KunoOP9mo ago
Regarding the REST API, let's admit I receive a request: "I want to land on your runway", after that I have to analyze the information about my runway (is that possible to land on rigth now ?) from business logic, and this business logic is a separate console app, and I don't understand how to use this console app from REST API ?
Scytale
Scytale9mo ago
you should not use the console app from the api calls, but split UI (console app) from the business logic (ex: create a domain and/or a service layer), and you call those layers from your api, ignoring your console app
Kuno
KunoOP9mo ago
I already did that, thank you guys, problem is solved
Scytale
Scytale9mo ago
❤️
Want results from more Discord servers?
Add your server