Results.NotFound Method

Definition

Overloads

NotFound(Object)

Source:
Results.cs

Produces a Status404NotFound response.

C#
public static Microsoft.AspNetCore.Http.IResult NotFound (object? value = default);

Parameters

value
Object

The value to be included in the HTTP response body.

Returns

The created IResult for the response.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 6.0, 7.0, 8.0, 9.0

NotFound<TValue>(TValue)

Source:
Results.cs

Produces a Status404NotFound response.

C#
public static Microsoft.AspNetCore.Http.IResult NotFound<TValue> (TValue? value);

Type Parameters

TValue

Parameters

value
TValue

The value to be included in the HTTP response body.

Returns

The created IResult for the response.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 7.0, 8.0, 9.0