Skip to content

Commit ad05466

Browse files
committed
- update readme
1 parent e487455 commit ad05466

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,35 @@ The WebResultEndpoint and ServiceResultEndpoint abstractions are a structured ap
1414

1515
## Key Features
1616

17-
- Encapsulates endpoint behaviors like request validation, business logic, and response mapping into a single class.
17+
- Encapsulates endpoint behaviors like request validation, request handling, and response mapping.
1818
- Separates concerns to promote clean, maintainable code.
19-
- Uses the minimal APIs and routing system provided by ASP.NET Core. Configuration, parameter binding, authentication, Open Api tooling, filters, etc. are all minimal apis under the hood. Supports anything that Minimal Apis does.
19+
- Uses the Minimal Apis and routing system provided by ASP.NET Core. Configuration, parameter binding, authentication, Open Api tooling, filters, etc. are all Minimal Apis under the hood. Supports anything that Minimal Apis does.
2020
- Abstracts the logic for converting business results into HTTP responses.
21-
- Supports auto discovery and registration of endpoints.
22-
- Has built-in validation support and integrates seamlessly with FluentValidation. If a validator is registered for request model, it is automatically validated before being handled.
23-
- Supports constructor dependency injection.
21+
- Supports auto discovery and registration.
22+
- Has built-in validation support with [FluentValidation](https://github.com/FluentValidation/FluentValidation). If a validator is registered for request model, it is automatically validated before being handled.
23+
- Supports constructor dependency injection in endpoint implementations.
24+
25+
## Performance
26+
27+
WebResultEndpoints have a slight overhead (3-4%) over regular Minimal Apis on request/sec metric under load tests with 100 virtual users.
28+
29+
MinimalEndpoints perform about same as regular Minimal Apis.
30+
31+
The web apis called for tests, perform only in-process operations like resolving dependency, validating input, calling local methods with no network or disk I/O.
32+
33+
See [test results](./samples/BenchmarkWebApi/BenchmarkFiles/inprocess_benchmark_results.txt) under [BenchmarkFiles](https://github.com/modabas/ModEndpoints/tree/main/samples/BenchmarkWebApi/BenchmarkFiles) folder of BenchmarkWebApi project for detailed results and test scripts.
2434

2535
## Workflow
2636

27-
An endpoint must implement 2 virtual methods: Configure and HandleAsync.
37+
An endpoint must implement two virtual methods: Configure and HandleAsync.
2838

2939
### Configuration:
3040

3141
The 'Configure' method is called at application startup to define routes and associate them with handler methods (MapGet, MapPost, etc.).
3242

3343
### Request Handling:
3444

35-
The request is processed in 'HandleAsync' method which returns a [result](https://github.com/modabas/ModResults). This result is handled differently for each endpoint type beofre being sent to client.
45+
The request is processed in 'HandleAsync' method which returns a [result](https://github.com/modabas/ModResults). This result is handled differently for each endpoint type before being sent to client.
3646

3747
## Endpoint Types
3848

@@ -187,15 +197,14 @@ internal class UploadBookRequestValidator : AbstractValidator<UploadBookRequest>
187197
}
188198
}
189199

190-
[RouteGroupMember(typeof(BooksV2RouteGroup))]
191200
internal class UploadBook
192201
: WebResultEndpoint<UploadBookRequest, UploadBookResponse>
193202
{
194203
protected override void Configure(
195204
IServiceProvider serviceProvider,
196205
IRouteGroupConfigurator? parentRouteGroup)
197206
{
198-
MapPost("/upload/{Title}")
207+
MapPost("/books/upload/{Title}")
199208
.DisableAntiforgery()
200209
.Produces<UploadBookResponse>();
201210
}

0 commit comments

Comments
 (0)