Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions docs/src/content/docs/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ description: "Install AxisEndpoints and optional extension packages in your ASP.

import { LinkCard, CardGrid } from '@astrojs/starlight/components';

## NuGet Packages (Recommended)

<CardGrid>
<LinkCard title="AxisEndpoints" href="https://www.nuget.org/packages/AxisEndpoints" description="Core package" />
<LinkCard title="AxisEndpoints.Extensions.CsvHelper" href="https://www.nuget.org/packages/AxisEndpoints.Extensions.CsvHelper" description="CSV import/export extension" />
</CardGrid>

## Install from nuget.org
## Install from nuget.org (Recommended)

Add the core package to your project:
Packages are available on nuget.org. Run the following command in your project directory to install the core package:

```sh
dotnet add package AxisEndpoints
Expand All @@ -26,6 +21,11 @@ For the CSV extension:
dotnet add package AxisEndpoints.Extensions.CsvHelper
```

<CardGrid>
<LinkCard title="AxisEndpoints" href="https://www.nuget.org/packages/AxisEndpoints" description="Core package" />
<LinkCard title="AxisEndpoints.Extensions.CsvHelper" href="https://www.nuget.org/packages/AxisEndpoints.Extensions.CsvHelper" description="CSV import/export extension" />
</CardGrid>

## Install from local nupkg

If you are building from source or testing a pre-release version, you can install from a local `.nupkg` file:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { Steps } from '@astrojs/starlight/components';

4. **Create your first endpoint**

Here is an example of a POST endpoint that creates a user and returns a JSON response:
Create a new class `CreateUserEndpoint` that implements `IEndpoint<CreateUserRequest, Response<CreateUserResponse>>` at `CreateUserEndpoint.cs`. This endpoint will handle POST requests to create a new user.

```csharp
public class CreateUserRequest
Expand Down
42 changes: 6 additions & 36 deletions docs/src/content/docs/guides/core-primitives.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,42 +98,6 @@ flowchart TD
I --> H
```

---

## Type Relationships

The following diagram shows how the core types relate to each other.

```mermaid
classDiagram
class IEndpoint_TRequest_TResult {
+Configure(IEndpointConfiguration config)
+HandleAsync(TRequest request, CancellationToken cancel) Task~TResult~
}
class IEndpoint_TResult {
+Configure(IEndpointConfiguration config)
+HandleAsync(CancellationToken cancel) Task~TResult~
}
class Response_TBody {
+StatusCode HttpStatusCode
+Headers IReadOnlyList
+Body TBody
}
class EmptyResponse
class IEndpointGroup {
+Configure(IEndpointGroupConfiguration config)
}
class EndpointContext {
+RequestHeaders IHeaderDictionary
+User ClaimsPrincipal
+Query IQueryCollection
+GetRouteValue(key) string?
+RawResponse HttpResponse
}
```

---

## Notes on ASP.NET Core Standard Types

AxisEndpoints builds directly on ASP.NET Core standard types. The types below are not AxisEndpoints-specific, so standard Minimal API knowledge applies as-is.
Expand All @@ -142,10 +106,16 @@ AxisEndpoints builds directly on ASP.NET Core standard types. The types below ar

This interface is provided by ASP.NET Core Minimal APIs and represents an HTTP response. It is produced by factory methods such as `Results.Json()`, `Results.Problem()`, `Results.Ok()`, and `Results.NotFound()`. In AxisEndpoints, specifying `IResult` as the return type of `HandleAsync` lets you return different response shapes based on the outcome, such as JSON on success and `ProblemDetails` on error.

> [IResult - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult)

### `ProblemDetails`

`Microsoft.AspNetCore.Mvc.ProblemDetails` provides the standard error response format defined by RFC 9457 (formerly RFC 7807). It includes fields such as `type`, `title`, `status`, `detail`, and `errors`, which bring consistency to API error responses. AxisEndpoints' DataAnnotations validation filter also returns validation errors in this format.

> [ProblemDetails - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.problemdetails)

### `IEndpointFilter`

This filter interface is provided by ASP.NET Core Minimal APIs and lets you insert logic into the request pipeline. Unlike middleware, it can be scoped to specific endpoints or groups, which gives you finer control over cross-cutting concerns.

> [IEndpointFilter - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iendpointfilter)
Loading