Broad question #447
-
I wrote my db apps using Entity Framework Core and cli CommandDotNet |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It really depends on what your needs are. In most cases, you'll want your business logic for a domain to live in one place. If you want to expose that logic via network API so it can be accessed by other applications, then I would usually expose the logic in the API and have console apps call the endpoints. There are many benefits to this approach
There are some reasons not to move commands behind an API
There have been cases where I would make the domain logic available to both the API and the CLI and my deployment process would deploy both at the same time so I didn't worry about business logic being out of sync between them. There are risks if the commands run for a very long period of time though. Those are some off-the-top-of-my-head thoughts on it. |
Beta Was this translation helpful? Give feedback.
It really depends on what your needs are. In most cases, you'll want your business logic for a domain to live in one place. If you want to expose that logic via network API so it can be accessed by other applications, then I would usually expose the logic in the API and have console apps call the endpoints.
There are many benefits to this approach
There are some reasons not to move commands behind an API