You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ internal class ListBooks(ServiceDbContext db)
148
148
149
149
### Parameter binding
150
150
151
-
Request model defined for an endpoint is bound with [AsParameters] attribute. Any field under request model can be bound from route, query, body, form, etc. with corresponding [From...] attribute (see [Minimal Apis Parameter Binding](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/parameter-binding?view=aspnetcore-8.0) for more information).
151
+
Request model defined for an endpoint is bound with [AsParameters] attribute (except for ServiceEndpoints). Any field under request model can be bound from route, query, body, form, etc. with corresponding [From...] attribute (see [Minimal Apis Parameter Binding](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/parameter-binding?view=aspnetcore-8.0) for more information).
152
152
153
153
The following sample demonstrates route and body parameter binding.
154
154
@@ -383,14 +383,15 @@ This is a very specialized endpoint suitable for internal services. A ServiceEnd
383
383
- ServiceEndpoint<TRequest>: Has a request model, supports request validation and returns a [Result](https://github.com/modabas/ModResults) within HTTP 200 IResult.
384
384
385
385
A ServiceEndpoint has following special traits and constraints:
386
-
- A ServiceEndpoint is always registered with HttpMethod.Post method, and its bound pattern is determined accourding to its request type.
387
-
- A ServiceEndpoint's request must implement either IServiceRequest (for ServiceEndpoint<TRequest>) or IServiceRequest<TResultValue> (for ServiceEndpoint<TRequest, TResultValue>)
386
+
- A ServiceEndpoint is always registered as a POST method, and its bound pattern is determined accourding to its request type.
387
+
- Request model defined for a ServiceEndpoint is bound with [FromBody] attribute.
388
+
- A ServiceEndpoint's request must implement either IServiceRequest (for endpoints implementing ServiceEndpoint<TRequest>) or IServiceRequest<TResultValue> (for endpoints implementing ServiceEndpoint<TRequest, TResultValue>)
388
389
- A ServiceEndpoint's request is specific to that endpoint. Each endpoint must have its unique request type.
389
390
- To utilize the advantages of a ServiceEndpoint over other endpoint types, its request and response types has to be shared with clients and therefore has to be in a seperate class library.
390
391
391
392
These enable clients to call ServiceEndpoints by a specialized message channel resolved from dependency injection, which has to be registered at client application startup with only service base address and service request type information. No other knowledge about service or client implementation is required.
392
393
393
-
Have a look at [sample ServiceEndpoint implementations](https://github.com/modabas/ModEndpoints/tree/main/samples/ShowcaseWebApi/Features/StoresWithServiceEndpoints) along with [sample client implementation](https://github.com/modabas/ModEndpoints/tree/main/samples/Client) and [request/response model shared library](https://github.com/modabas/ModEndpoints/tree/main/samples/ShowcaseWebApi.FeatureContracts).
394
+
Have a look at [sample ServiceEndpoint implementations](https://github.com/modabas/ModEndpoints/tree/main/samples/ShowcaseWebApi/Features/StoresWithServiceEndpoint) along with [sample client implementation](https://github.com/modabas/ModEndpoints/tree/main/samples/Client) and [request/response model shared library](https://github.com/modabas/ModEndpoints/tree/main/samples/ShowcaseWebApi.FeatureContracts).
0 commit comments