Skip to content

External Web APIs models #791

Answered by danielbecroft
SashoKukui asked this question in Q&A
Discussion options

You must be logged in to vote

Is this consuming an external service, or exposing a separates service?

For consuming a service, I put the models either (a) in Application, or (b) put everything in a separate project. For example:

Application\ExternalService\IExternalService.cs
Application\ExternalService\Models\Customer.cs
Application\ExternalService\Models\CustomerAddress.cs
etc.

then

Infrastructure\ExternalService\ExternalService.cs << implements Application.ExternalService.IExternalService

The Application layer then only uses the interface and models, and can be mocked for testing. The implementation layer in the external service then can use the interface and the models.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SashoKukui
Comment options

@danielbecroft
Comment options

Answer selected by SashoKukui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants