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
+18-9Lines changed: 18 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,25 +14,35 @@ The WebResultEndpoint and ServiceResultEndpoint abstractions are a structured ap
14
14
15
15
## Key Features
16
16
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.
18
18
- 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.
20
20
- 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.
24
34
25
35
## Workflow
26
36
27
-
An endpoint must implement 2 virtual methods: Configure and HandleAsync.
37
+
An endpoint must implement two virtual methods: Configure and HandleAsync.
28
38
29
39
### Configuration:
30
40
31
41
The 'Configure' method is called at application startup to define routes and associate them with handler methods (MapGet, MapPost, etc.).
32
42
33
43
### Request Handling:
34
44
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.
36
46
37
47
## Endpoint Types
38
48
@@ -187,15 +197,14 @@ internal class UploadBookRequestValidator : AbstractValidator<UploadBookRequest>
0 commit comments