Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalis committed Oct 2, 2023
1 parent be0f270 commit 8ae6a38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sample/SampleEndpointApp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ dotnet ef database update

## Duplicate Code in Endpoints

If the duplicate dependency code in the endpoints bothers you, you can avoid it easily by creating your own `AppEndpointBaseSync` classes that inherit from `EndpointBaseSync`. These can expose as properties any common dependencies like loggers, mappers, or generic repositories, and then use an IOC container's property injection feature to ensure they're always populated when the endpoint is created.
If the duplicate dependency code in the endpoints bothers you, you can avoid it easily by creating your own `AppEndpointBaseSync` classes and your own set of extensions that mirror those in `EndpointBaseSync`. Your new base class expose as properties any common dependencies like loggers, mappers, or generic repositories, and then use an IOC container's property injection feature to ensure they're always populated when the endpoint is created.

0 comments on commit 8ae6a38

Please sign in to comment.