Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusz96 authored Jun 8, 2024
1 parent 6d16435 commit 4a73112
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Uri Generation
A strongly typed URL generation library for ASP.NET Core:
```C#
// uri:
// https://localhost:44339/api/invoices/2
string? uri = _uriGenerator.GetUriByExpression<InvoicesController>(
httpContext,
c => c.GetInvoice(2));
Expand Down Expand Up @@ -52,12 +54,16 @@ app.MapControllerRoute(
```
you can specify an endpoint name to generate an endpoint-specific URL:
```C#
// uri:
// https://localhost:44339/api/invoices/2
string? uri = _uriGenerator.GetUriByExpression<InvoicesController>(
httpContext,
c => c.GetInvoice(2),
"ApiGetInvoice");
```
```C#
// uri:
// https://localhost:44339/invoices/2
string? uri = _uriGenerator.GetUriByExpression<InvoicesController>(
httpContext,
c => c.GetInvoice(2),
Expand Down

0 comments on commit 4a73112

Please sign in to comment.