Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helpful info about using multiple routes and methods #30

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/routes/docs/[...20]misc-conveniences.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
<img width="743" alt="image" src="https://github.com/user-attachments/assets/e964dbe5-cecd-44ca-99f3-896f207e3379" />---
title: Misc Conveniences
description: A light-weight REST Api framework for ASP.Net 6 that implements REPR (Request-Endpoint-Response) Pattern.
---
Expand All @@ -17,7 +17,7 @@ Options(b => b.RequireCors(x => x.AllowAnyOrigin())

## Multiple Verbs & Routes

A single endpoint can be made to listen to more than one type of http verb and on multiple routes like below. This is sometimes useful when your endpoint handler code is almost the same with a minor variation across different routes/verbs. Instead of creating multiple endpoint classes, you can use this strategy to handle multiple use-cases with a single piece of handler logic.
A single endpoint can be made to listen to more than one type of http verb and on multiple routes like below. This is sometimes useful when your endpoint handler code is almost the same with a minor variation across different routes/verbs. Instead of creating multiple endpoint classes, you can use this strategy to handle multiple use-cases with a single piece of handler logic via `HttpContext.Request.Path` and `HttpContext.Request.HttpMethod`.

```cs | title=MyEndpoint.cs
public override void Configure()
Expand Down Expand Up @@ -236,4 +236,4 @@ The following 5 hook methods allow you to do something before and after DTO vali
override this method if you'd like to do something to the request dto before the handler is executed.

- **OnAfterHandle()**
override this method if you'd like to do something after the handler is executed.
override this method if you'd like to do something after the handler is executed.