78 implementations of IResult
Aspire.Dashboard (1)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (1)
140private sealed class OtlpResult<T> : IResult where T : IMessage
Microsoft.AspNetCore.Components.Endpoints (1)
Results\RazorComponentResult.cs (1)
16public class RazorComponentResult : IResult, IStatusCodeHttpResult, IContentTypeHttpResult
Microsoft.AspNetCore.Http.Abstractions (1)
HttpResults\EmptyHttpResult.cs (1)
10public sealed class EmptyHttpResult : IResult
Microsoft.AspNetCore.Http.Extensions.Tests (12)
RequestDelegateFactoryTests.cs (7)
3291private class AccessesServicesMetadataResult : IResult, IEndpointMetadataProvider 3326private class AddsCustomEndpointMetadataResult : IEndpointMetadataProvider, IResult 3336private class AddsNoEndpointMetadataResult : IEndpointMetadataProvider, IResult 3346private class CountsDefaultEndpointMetadataResult : IEndpointMetadataProvider, IResult 3402private class RemovesAcceptsMetadataResult : IEndpointMetadataProvider, IResult 3601private class CustomResult : IResult 3616private struct StructResult : IResult
RequestDelegateGenerator\SharedTypes.cs (5)
617public class AddsCustomEndpointMetadataResult : IEndpointMetadataProvider, IResult 627public class AccessesServicesMetadataResult : IResult, IEndpointMetadataProvider 658public class RemovesAcceptsMetadataResult : IEndpointMetadataProvider, IResult 923public class CountsDefaultEndpointMetadataResult : IEndpointMetadataProvider, IResult 973public class Status410Result : IResult
Microsoft.AspNetCore.Http.Microbenchmarks (5)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (5)
617public class AddsCustomEndpointMetadataResult : IEndpointMetadataProvider, IResult 627public class AccessesServicesMetadataResult : IResult, IEndpointMetadataProvider 658public class RemovesAcceptsMetadataResult : IEndpointMetadataProvider, IResult 923public class CountsDefaultEndpointMetadataResult : IEndpointMetadataProvider, IResult 973public class Status410Result : IResult
Microsoft.AspNetCore.Http.Results (44)
Accepted.cs (1)
17public sealed class Accepted : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
AcceptedAtRoute.cs (1)
20public sealed class AcceptedAtRoute : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
AcceptedAtRouteOfT.cs (1)
21public sealed class AcceptedAtRoute<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
AcceptedOfT.cs (1)
17public sealed class Accepted<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
BadRequest.cs (1)
16public sealed class BadRequest : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
BadRequestOfT.cs (1)
17public sealed class BadRequest<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
ChallengeHttpResult.cs (1)
14public sealed partial class ChallengeHttpResult : IResult
Conflict.cs (1)
16public sealed class Conflict : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
ConflictOfT.cs (1)
17public sealed class Conflict<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
ContentHttpResult.cs (1)
13public sealed partial class ContentHttpResult : IResult, IStatusCodeHttpResult, IContentTypeHttpResult
Created.cs (1)
16public sealed class Created : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
CreatedAtRoute.cs (1)
20public sealed class CreatedAtRoute : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
CreatedAtRouteOfT.cs (1)
21public sealed class CreatedAtRoute<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
CreatedOfT.cs (1)
17public sealed class Created<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
FileContentHttpResult.cs (1)
15public sealed partial class FileContentHttpResult : IResult, IFileHttpResult, IContentTypeHttpResult
FileStreamHttpResult.cs (1)
15public sealed class FileStreamHttpResult : IResult, IFileHttpResult, IContentTypeHttpResult
ForbidHttpResult.cs (1)
14public sealed partial class ForbidHttpResult : IResult
InternalServerError.cs (1)
16public sealed class InternalServerError : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
InternalServerErrorOfT.cs (1)
17public sealed class InternalServerError<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
JsonHttpResultOfT.cs (1)
16public sealed partial class JsonHttpResult<TValue> : IResult, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>, IContentTypeHttpResult
NoContent.cs (1)
16public class NoContent : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
NotFound.cs (1)
16public sealed class NotFound : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
NotFoundOfT.cs (1)
17public sealed class NotFound<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
Ok.cs (1)
16public sealed class Ok : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
OkOfT.cs (1)
17public sealed class Ok<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
PhysicalFileHttpResult.cs (1)
14public sealed partial class PhysicalFileHttpResult : IResult, IFileHttpResult, IContentTypeHttpResult
ProblemHttpResult.cs (1)
14public sealed class ProblemHttpResult : IResult, IStatusCodeHttpResult, IContentTypeHttpResult, IValueHttpResult, IValueHttpResult<ProblemDetails>
PushStreamHttpResult.cs (1)
14public sealed class PushStreamHttpResult : IResult, IFileHttpResult, IContentTypeHttpResult
RedirectHttpResult.cs (1)
15public sealed partial class RedirectHttpResult : IResult
RedirectToRouteHttpResult.cs (1)
17public sealed partial class RedirectToRouteHttpResult : IResult
ResultsOfT.Generated.cs (5)
24public sealed class Results<[DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult1, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult2> : IResult, INestedHttpResult, IEndpointMetadataProvider 87public sealed class Results<[DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult1, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult2, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult3> : IResult, INestedHttpResult, IEndpointMetadataProvider 159public sealed class Results<[DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult1, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult2, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult3, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult4> : IResult, INestedHttpResult, IEndpointMetadataProvider 240public sealed class Results<[DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult1, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult2, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult3, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult4, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult5> : IResult, INestedHttpResult, IEndpointMetadataProvider 330public sealed class Results<[DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult1, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult2, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult3, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult4, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult5, [DynamicallyAccessedMembers(ResultsOfTHelper.RequireMethods)] TResult6> : IResult, INestedHttpResult, IEndpointMetadataProvider
SignInHttpResult.cs (1)
14public sealed partial class SignInHttpResult : IResult
SignOutHttpResult.cs (1)
14public sealed partial class SignOutHttpResult : IResult
StatusCodeHttpResult.cs (1)
13public sealed partial class StatusCodeHttpResult : IResult, IStatusCodeHttpResult
UnauthorizedHttpResult.cs (1)
13public sealed class UnauthorizedHttpResult : IResult, IStatusCodeHttpResult
UnprocessableEntity.cs (1)
16public sealed class UnprocessableEntity : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult
UnprocessableEntityOfT.cs (1)
17public sealed class UnprocessableEntity<TValue> : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IValueHttpResult, IValueHttpResult<TValue>
Utf8ContentHttpResult.cs (1)
13public sealed partial class Utf8ContentHttpResult : IResult, IStatusCodeHttpResult, IContentTypeHttpResult
ValidationProblem.cs (1)
16public sealed class ValidationProblem : IResult, IEndpointMetadataProvider, IStatusCodeHttpResult, IContentTypeHttpResult, IValueHttpResult, IValueHttpResult<HttpValidationProblemDetails>
VirtualFileHttpResult.cs (1)
17public sealed class VirtualFileHttpResult : IResult, IFileHttpResult, IContentTypeHttpResult
Microsoft.AspNetCore.Http.Results.Tests (8)
ResultsOfTTests.Generated.cs (8)
1841abstract class ChecksumResult : IResult 1861class ProvidesMetadataResult1 : IResult, IEndpointMetadataProvider 1875class ProvidesMetadataResult2 : IResult, IEndpointMetadataProvider 1889class ProvidesMetadataResult3 : IResult, IEndpointMetadataProvider 1903class ProvidesMetadataResult4 : IResult, IEndpointMetadataProvider 1917class ProvidesMetadataResult5 : IResult, IEndpointMetadataProvider 1931class ProvidesMetadataResult6 : IResult, IEndpointMetadataProvider 1944class ProvidesMetadataResult7 : IResult, IEndpointMetadataProvider
Microsoft.AspNetCore.Mvc.Core (1)
SignOutResult.cs (1)
16public partial class SignOutResult : ActionResult, IResult
Microsoft.AspNetCore.Mvc.Core.Test (4)
ActionResultOfTTest.cs (1)
121private class TestResult : IResult
ApplicationModels\EndpointMetadataProviderTest.cs (2)
405private class AddsCustomEndpointMetadataResult : IEndpointMetadataProvider, IResult 437private class RemovesAcceptsMetadataResult : IEndpointMetadataProvider, IResult
Infrastructure\ActionResultTypeMapperTest.cs (1)
105private class CustomConvertibleIResult : IConvertToActionResult, IResult
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
551private class AddsCustomEndpointMetadataResult : IEndpointMetadataProvider, IResult
313 references to IResult
AzureFunctionsEndToEnd.Functions (1)
MyHttpTrigger.cs (1)
28public IResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequest req)
BasicWebSite (2)
Controllers\ContactApiController.cs (2)
136public IResult ActionReturningObjectIResult(int id) 140public IResult ActionReturningStatusCodeIResult()
Microsoft.AspNetCore.App.Analyzers.Test (1)
Verifiers\CSharpAnalyzerVerifier.cs (1)
88TrimAssemblyExtension(typeof(Microsoft.AspNetCore.Http.IResult).Assembly.Location),
Microsoft.AspNetCore.Components.Endpoints (2)
Results\RazorComponentResult.cs (1)
14/// An <see cref="IResult"/> that renders a Razor Component.
Results\RazorComponentResultOfT.cs (1)
11/// An <see cref="IResult"/> that renders a Razor Component.
Microsoft.AspNetCore.Http.Abstractions (5)
HttpResults\EmptyHttpResult.cs (1)
7/// Represents an <see cref="IResult"/> that when executed will
HttpResults\INestedHttpResult.cs (4)
8/// that contains a nested <see cref="IResult"/> type. 10/// <remarks>For example, <c>Results&lt;TResult1, TResult2&gt;</c> is an <see cref="INestedHttpResult"/> and will contain the returned <see cref="IResult"/>.</remarks> 14/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 16IResult Result { get; }
Microsoft.AspNetCore.Http.Extensions (12)
RequestDelegateFactory.cs (11)
1040if (!isAwaitable && (returnType == typeof(void) || typeof(IResult).IsAssignableFrom(returnType))) 1115if (typeof(IResult).IsAssignableFrom(typeArg)) 1163if (typeof(IResult).IsAssignableFrom(typeArg)) 1212else if (typeof(IResult).IsAssignableFrom(returnType)) 1216var box = Expression.TypeAs(methodCall, typeof(IResult)); 2578private static Task ExecuteValueTaskResult<T>(ValueTask<T?> task, HttpContext httpContext) where T : IResult 2593private static async Task ExecuteTaskResult<T>(Task<T?> task, HttpContext httpContext) where T : IResult 2600private static async Task ExecuteResultWriteResponse(IResult? result, HttpContext httpContext) 2797private static void EnsureRequestTaskOfNotNull<T>(Task<T?> task) where T : IResult 2813private static IResult EnsureRequestResultNotNull(IResult? result)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
15if (obj is IResult result)
Microsoft.AspNetCore.Http.Extensions.Tests (13)
RequestDelegateFactoryTests.cs (12)
1492IResult? TestAction() => null; 1494Task<IResult?>? TaskNullAction() => null; 1495Task<IResult?> TaskTestAction() => Task.FromResult<IResult?>(null); 1496ValueTask<IResult?> ValueTaskTestAction() => ValueTask.FromResult<IResult?>(null); 1500new object[] { (Func<IResult?>)TestAction, "The IResult returned by the Delegate must not be null." }, 1501new object[] { (Func<Task<IResult?>?>)TaskNullAction, "The IResult in Task<IResult> response must not be null." }, 1503new object[] { (Func<Task<IResult?>>)TaskTestAction, "The IResult returned by the Delegate must not be null." }, 1504new object[] { (Func<ValueTask<IResult?>>)ValueTaskTestAction, "The IResult returned by the Delegate must not be null." }, 1859IResult actionWithExtensionsResult(string name) => Results.Extensions.TestResult(name); 3810public static IResult TestResult(this IResultExtensions resultExtensions, string name)
RequestDelegateGenerator\SharedTypes.cs (1)
975Task IResult.ExecuteAsync(HttpContext httpContext)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
975Task IResult.ExecuteAsync(HttpContext httpContext)
Microsoft.AspNetCore.Http.Results (219)
Accepted.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
AcceptedAtRoute.cs (1)
16/// An <see cref="IResult"/> that on execution will write an object to the response
AcceptedAtRouteOfT.cs (1)
16/// An <see cref="IResult"/> that on execution will write an object to the response
AcceptedOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
BadRequest.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
BadRequestOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
ChallengeHttpResult.cs (1)
12/// An <see cref="IResult"/> that on execution invokes <see cref="M:HttpContext.ChallengeAsync"/>.
Conflict.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
ConflictOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
Created.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
CreatedAtRoute.cs (1)
16/// An <see cref="IResult"/> that on execution will write an object to the response
CreatedAtRouteOfT.cs (1)
16/// An <see cref="IResult"/> that on execution will write an object to the response
CreatedOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
FileContentHttpResult.cs (1)
12/// Represents an <see cref="IResult"/> that when executed will
FileStreamHttpResult.cs (1)
12/// Represents an <see cref="IResult"/> that when executed will
ForbidHttpResult.cs (1)
12/// An <see cref="IResult"/> that on execution invokes <see cref="M:HttpContext.ForbidAsync"/>.
InternalServerError.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
InternalServerErrorOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
NoContent.cs (1)
13/// Represents an <see cref="IResult"/> that when executed will
NotFound.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
NotFoundOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
Ok.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
OkOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
ProblemHttpResult.cs (1)
11/// An <see cref="IResult"/> that on execution will write Problem Details
PushStreamHttpResult.cs (1)
11/// Represents an <see cref="IResult"/> that when executed will
RedirectHttpResult.cs (1)
12/// An <see cref="IResult"/> that returns a Found (302), Moved Permanently (301), Temporary Redirect (307),
RedirectToRouteHttpResult.cs (1)
13/// An <see cref="IResult"/> that returns a Found (302), Moved Permanently (301), Temporary Redirect (307),
Results.cs (133)
22/// A factory for <see cref="IResult"/>. 27/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ChallengeAsync(HttpContext, string?, AuthenticationProperties?)" />. 37/// <returns>The created <see cref="IResult"/> for the response.</returns> 38public static IResult Challenge( 44/// Creates a <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ForbidAsync(HttpContext, string?, AuthenticationProperties?)"/>. 53/// <returns>The created <see cref="IResult"/> for the response.</returns> 58public static IResult Forbid(AuthenticationProperties? properties = null, IList<string>? authenticationSchemes = null) 62/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignInAsync(HttpContext, string?, ClaimsPrincipal, AuthenticationProperties?)" />. 67/// <returns>The created <see cref="IResult"/> for the response.</returns> 68public static IResult SignIn( 75/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignOutAsync(HttpContext, string?, AuthenticationProperties?)" />. 79/// <returns>The created <see cref="IResult"/> for the response.</returns> 80public static IResult SignOut(AuthenticationProperties? properties = null, IList<string>? authenticationSchemes = null) 92/// <returns>The created <see cref="IResult"/> object for the response.</returns> 97public static IResult Content(string? content, string? contentType, Encoding? contentEncoding) 110/// <returns>The created <see cref="IResult"/> object for the response.</returns> 115public static IResult Content(string? content, string? contentType = null, Encoding? contentEncoding = null, int? statusCode = null) 127/// <returns>The created <see cref="IResult"/> object for the response.</returns> 132public static IResult Text(string? content, string? contentType, Encoding? contentEncoding) 145/// <returns>The created <see cref="IResult"/> object for the response.</returns> 150public static IResult Text(string? content, string? contentType = null, Encoding? contentEncoding = null, int? statusCode = null) 159/// <returns>The created <see cref="IResult"/> object for the response.</returns> 160public static IResult Text(ReadOnlySpan<byte> utf8Content, string? contentType = null, int? statusCode = null) 168/// <returns>The created <see cref="IResult"/> object for the response.</returns> 169public static IResult Content(string? content, MediaTypeHeaderValue contentType) 173/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON. 185public static IResult Json(object? data, JsonSerializerOptions? options = null, string? contentType = null, int? statusCode = null) 189/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON. 200public static IResult Json(object? data, JsonTypeInfo jsonTypeInfo, string? contentType = null, int? statusCode = null) 207/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON. 219public static IResult Json(object? data, Type type, JsonSerializerContext context, string? contentType = null, int? statusCode = null) 229/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON. 241public static IResult Json<TValue>(TValue? data, JsonSerializerOptions? options = null, string? contentType = null, int? statusCode = null) 246/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON. 257public static IResult Json<TValue>(TValue? data, JsonTypeInfo<TValue> jsonTypeInfo, string? contentType = null, int? statusCode = null) 262/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON. 273public static IResult Json<TValue>(TValue? data, JsonSerializerContext context, string? contentType = null, int? statusCode = null) 292/// <returns>The created <see cref="IResult"/> for the response.</returns> 293public static IResult File( 317/// <returns>The created <see cref="IResult"/> for the response.</returns> 318public static IResult Bytes( 340/// <returns>The created <see cref="IResult"/> for the response.</returns> 341public static IResult Bytes( 368/// <returns>The created <see cref="IResult"/> for the response.</returns> 372public static IResult File( 399/// <returns>The created <see cref="IResult"/> for the response.</returns> 403public static IResult Stream( 427/// <returns>The created <see cref="IResult"/> for the response.</returns> 431public static IResult Stream( 450/// <returns>The created <see cref="IResult"/> for the response.</returns> 451public static IResult Stream( 472/// <returns>The created <see cref="IResult"/> for the response.</returns> 473public static IResult File( 504/// <returns>The created <see cref="IResult"/> for the response.</returns> 505public static IResult Redirect([StringSyntax(StringSyntaxAttribute.Uri)] string url, bool permanent = false, bool preserveMethod = false) 528/// <returns>The created <see cref="IResult"/> for the response.</returns> 529public static IResult LocalRedirect([StringSyntax(StringSyntaxAttribute.Uri, UriKind.Relative)] string localUrl, bool permanent = false, bool preserveMethod = false) 554/// <returns>The created <see cref="IResult"/> for the response.</returns> 556public static IResult RedirectToRoute(string? routeName = null, object? routeValues = null, bool permanent = false, bool preserveMethod = false, string? fragment = null) 581/// <returns>The created <see cref="IResult"/> for the response.</returns> 583public static IResult RedirectToRoute(string? routeName, RouteValueDictionary? routeValues, bool permanent = false, bool preserveMethod = false, string? fragment = null) 588/// Creates an <see cref="IResult"/> object by specifying a <paramref name="statusCode"/>. 591/// <returns>The created <see cref="IResult"/> object for the response.</returns> 592public static IResult StatusCode(int statusCode) 599/// <returns>The created <see cref="IResult"/> for the response.</returns> 600public static IResult NotFound(object? value = null) 607/// <returns>The created <see cref="IResult"/> for the response.</returns> 608public static IResult NotFound<TValue>(TValue? value) 614/// <returns>The created <see cref="IResult"/> for the response.</returns> 615public static IResult Unauthorized() 622/// <returns>The created <see cref="IResult"/> for the response.</returns> 623public static IResult BadRequest(object? error = null) 630/// <returns>The created <see cref="IResult"/> for the response.</returns> 631public static IResult BadRequest<TValue>(TValue? error) 638/// <returns>The created <see cref="IResult"/> for the response.</returns> 639public static IResult Conflict(object? error = null) 646/// <returns>The created <see cref="IResult"/> for the response.</returns> 647public static IResult Conflict<TValue>(TValue? error) 653/// <returns>The created <see cref="IResult"/> for the response.</returns> 654public static IResult NoContent() 661/// <returns>The created <see cref="IResult"/> for the response.</returns> 662public static IResult Ok(object? value = null) 669/// <returns>The created <see cref="IResult"/> for the response.</returns> 670public static IResult Ok<TValue>(TValue? value) 677/// <returns>The created <see cref="IResult"/> for the response.</returns> 678public static IResult UnprocessableEntity(object? error = null) 685/// <returns>The created <see cref="IResult"/> for the response.</returns> 686public static IResult UnprocessableEntity<TValue>(TValue? error) 692/// <returns>The created <see cref="IResult"/> for the response.</returns> 693public static IResult InternalServerError() 700/// <returns>The created <see cref="IResult"/> for the response.</returns> 701public static IResult InternalServerError<TValue>(TValue? error) 713/// <returns>The created <see cref="IResult"/> for the response.</returns> 714public static IResult Problem( 732/// <returns>The created <see cref="IResult"/> for the response.</returns> 734public static IResult Problem( 748/// <returns>The created <see cref="IResult"/> for the response.</returns> 749public static IResult Problem(ProblemDetails problemDetails) 763/// <returns>The created <see cref="IResult"/> for the response.</returns> 764public static IResult ValidationProblem( 787/// <returns>The created <see cref="IResult"/> for the response.</returns> 789public static IResult ValidationProblem( 831/// <returns>The created <see cref="IResult"/> for the response.</returns> 832public static IResult Created() 840/// <returns>The created <see cref="IResult"/> for the response.</returns> 841public static IResult Created(string? uri, object? value) 849/// <returns>The created <see cref="IResult"/> for the response.</returns> 850public static IResult Created<TValue>(string? uri, TValue? value) 858/// <returns>The created <see cref="IResult"/> for the response.</returns> 859public static IResult Created(Uri? uri, object? value) 867/// <returns>The created <see cref="IResult"/> for the response.</returns> 868public static IResult Created<TValue>(Uri? uri, TValue? value) 877/// <returns>The created <see cref="IResult"/> for the response.</returns> 879public static IResult CreatedAtRoute(string? routeName = null, object? routeValues = null, object? value = null) 888/// <returns>The created <see cref="IResult"/> for the response.</returns> 890public static IResult CreatedAtRoute(string? routeName, RouteValueDictionary? routeValues, object? value = null) 900/// <returns>The created <see cref="IResult"/> for the response.</returns> 902public static IResult CreatedAtRoute<TValue>(string? routeName = null, object? routeValues = null, TValue? value = default) 911/// <returns>The created <see cref="IResult"/> for the response.</returns> 913public static IResult CreatedAtRoute<TValue>(string? routeName, RouteValueDictionary? routeValues, TValue? value = default) 922/// <returns>The created <see cref="IResult"/> for the response.</returns> 923public static IResult Accepted(string? uri = null, object? value = null) 931/// <returns>The created <see cref="IResult"/> for the response.</returns> 932public static IResult Accepted<TValue>(string? uri = null, TValue? value = default) 941/// <returns>The created <see cref="IResult"/> for the response.</returns> 943public static IResult AcceptedAtRoute(string? routeName = null, object? routeValues = null, object? value = null) 952/// <returns>The created <see cref="IResult"/> for the response.</returns> 954public static IResult AcceptedAtRoute(string? routeName, RouteValueDictionary? routeValues, object? value = null) 964/// <returns>The created <see cref="IResult"/> for the response.</returns> 966public static IResult AcceptedAtRoute<TValue>(string? routeName = null, object? routeValues = null, TValue? value = default) 975/// <returns>The created <see cref="IResult"/> for the response.</returns> 977public static IResult AcceptedAtRoute<TValue>(string? routeName, RouteValueDictionary? routeValues, TValue? value = default) 984public static IResult Empty { get; } = TypedResults.Empty;
ResultsOfT.Generated.cs (50)
14/// An <see cref="IResult"/> that could be one of two different <see cref="IResult"/> types. On execution will 15/// execute the underlying <see cref="IResult"/> instance that was actually returned by the HTTP endpoint. 25where TResult1 : IResult 26where TResult2 : IResult 29private Results(IResult activeResult) 35/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 37public IResult Result { get; } 76/// An <see cref="IResult"/> that could be one of three different <see cref="IResult"/> types. On execution will 77/// execute the underlying <see cref="IResult"/> instance that was actually returned by the HTTP endpoint. 88where TResult1 : IResult 89where TResult2 : IResult 90where TResult3 : IResult 93private Results(IResult activeResult) 99/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 101public IResult Result { get; } 147/// An <see cref="IResult"/> that could be one of four different <see cref="IResult"/> types. On execution will 148/// execute the underlying <see cref="IResult"/> instance that was actually returned by the HTTP endpoint. 160where TResult1 : IResult 161where TResult2 : IResult 162where TResult3 : IResult 163where TResult4 : IResult 166private Results(IResult activeResult) 172/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 174public IResult Result { get; } 227/// An <see cref="IResult"/> that could be one of five different <see cref="IResult"/> types. On execution will 228/// execute the underlying <see cref="IResult"/> instance that was actually returned by the HTTP endpoint. 241where TResult1 : IResult 242where TResult2 : IResult 243where TResult3 : IResult 244where TResult4 : IResult 245where TResult5 : IResult 248private Results(IResult activeResult) 254/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 256public IResult Result { get; } 316/// An <see cref="IResult"/> that could be one of six different <see cref="IResult"/> types. On execution will 317/// execute the underlying <see cref="IResult"/> instance that was actually returned by the HTTP endpoint. 331where TResult1 : IResult 332where TResult2 : IResult 333where TResult3 : IResult 334where TResult4 : IResult 335where TResult5 : IResult 336where TResult6 : IResult 339private Results(IResult activeResult) 345/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 347public IResult Result { get; }
SignInHttpResult.cs (1)
12/// An <see cref="IResult"/> that on execution invokes <see cref="M:HttpContext.SignInAsync"/>.
SignOutHttpResult.cs (1)
12/// An <see cref="IResult"/> that on execution invokes <see cref="M:HttpContext.SignOutAsync"/>.
StatusCodeHttpResult.cs (1)
10/// Represents an <see cref="IResult"/> that when executed will
TypedResults.cs (1)
22/// A typed factory for <see cref="IResult"/> types in <see cref="Microsoft.AspNetCore.Http.HttpResults"/>.
UnauthorizedHttpResult.cs (1)
10/// Represents an <see cref="IResult"/> that when executed will
UnprocessableEntity.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
UnprocessableEntityOfT.cs (1)
13/// An <see cref="IResult"/> that on execution will write an object to the response
ValidationProblem.cs (1)
13/// An <see cref="IResult"/> that on execution will write Problem Details
VirtualFileHttpResult.cs (1)
14/// A <see cref="IResult" /> that on execution writes the file specified
Microsoft.AspNetCore.Http.Results.Tests (26)
ResultsOfTTests.Generated.cs (20)
106Results<IResult, ChecksumResult2> MyApi(int id) 131Results<ChecksumResult1, IResult> MyApi(int id) 322Results<IResult, ChecksumResult2, ChecksumResult3> MyApi(int id) 349Results<ChecksumResult1, IResult, ChecksumResult3> MyApi(int id) 376Results<ChecksumResult1, ChecksumResult2, IResult> MyApi(int id) 607Results<IResult, ChecksumResult2, ChecksumResult3, ChecksumResult4> MyApi(int id) 636Results<ChecksumResult1, IResult, ChecksumResult3, ChecksumResult4> MyApi(int id) 665Results<ChecksumResult1, ChecksumResult2, IResult, ChecksumResult4> MyApi(int id) 694Results<ChecksumResult1, ChecksumResult2, ChecksumResult3, IResult> MyApi(int id) 969Results<IResult, ChecksumResult2, ChecksumResult3, ChecksumResult4, ChecksumResult5> MyApi(int id) 1000Results<ChecksumResult1, IResult, ChecksumResult3, ChecksumResult4, ChecksumResult5> MyApi(int id) 1031Results<ChecksumResult1, ChecksumResult2, IResult, ChecksumResult4, ChecksumResult5> MyApi(int id) 1062Results<ChecksumResult1, ChecksumResult2, ChecksumResult3, IResult, ChecksumResult5> MyApi(int id) 1093Results<ChecksumResult1, ChecksumResult2, ChecksumResult3, ChecksumResult4, IResult> MyApi(int id) 1416Results<IResult, ChecksumResult2, ChecksumResult3, ChecksumResult4, ChecksumResult5, ChecksumResult6> MyApi(int id) 1449Results<ChecksumResult1, IResult, ChecksumResult3, ChecksumResult4, ChecksumResult5, ChecksumResult6> MyApi(int id) 1482Results<ChecksumResult1, ChecksumResult2, IResult, ChecksumResult4, ChecksumResult5, ChecksumResult6> MyApi(int id) 1515Results<ChecksumResult1, ChecksumResult2, ChecksumResult3, IResult, ChecksumResult5, ChecksumResult6> MyApi(int id) 1548Results<ChecksumResult1, ChecksumResult2, ChecksumResult3, ChecksumResult4, IResult, ChecksumResult6> MyApi(int id) 1581Results<ChecksumResult1, ChecksumResult2, ChecksumResult3, ChecksumResult4, ChecksumResult5, IResult> MyApi(int id)
ResultsTests.cs (4)
299var result = overload switch 1700public void FactoryMethod_ReturnsCorrectResultType(Expression<Func<IResult>> expression, Type expectedReturnType) 1728private static IEnumerable<(Expression<Func<IResult>>, Type)> FactoryMethodsTuples { get; } = new List<(Expression<Func<IResult>>, Type)>
TypedResultsTests.cs (2)
383var result = overload switch 387_ => (IResult)TypedResults.Stream((s) => Task.CompletedTask, contentType, fileDownloadName, lastModified, entityTag)
Microsoft.AspNetCore.Mvc.ApiExplorer (4)
ApiResponseTypeProvider.cs (2)
236if (typeof(IResult).IsAssignableFrom(metadata.Type)) 368typeof(IResult).IsAssignableFrom(unwrappedType))
EndpointMetadataApiDescriptionProvider.cs (2)
337if (typeof(IResult).IsAssignableFrom(responseType) || 338producesResponseMetadata.Any(metadata => typeof(IResult).IsAssignableFrom(metadata.Type)))
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
ApiResponseTypeProviderTest.cs (1)
813public IResult GetIResult(int id) => null;
Microsoft.AspNetCore.Mvc.Core (10)
ActionResultOfT.cs (2)
25typeof(IResult).IsAssignableFrom(typeof(TValue))) 41typeof(IResult).IsAssignableFrom(typeof(TValue)))
HttpActionResult.cs (6)
9/// An <see cref="ActionResult"/> that when executed will produce a response based on the <see cref="IResult"/> provided. 14/// Gets the instance of the current <see cref="IResult"/>. 16public IResult Result { get; } 20/// <see cref="IResult"/> provided. 22/// <param name="result">The <see cref="IResult"/> instance to be used during the <see cref="ExecuteResultAsync"/> invocation.</param> 23public HttpActionResult(IResult result)
Infrastructure\ActionResultTypeMapper.cs (1)
34if (value is IResult httpResult)
SignOutResult.cs (1)
98Task IResult.ExecuteAsync(HttpContext httpContext)
Microsoft.AspNetCore.Mvc.Core.Test (9)
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (1)
227public IResult TestActionWithIResult(object value) => null;
HttpActionResultTests.cs (3)
20var httpResult = Mock.Of<IResult>(); 38var httpResult = new Mock<IResult>();
Infrastructure\ActionResultTypeMapperTest.cs (2)
33var returnValue = Mock.Of<IResult>();
SignOutResultTest.cs (3)
114await ((IResult)result).ExecuteAsync(httpContext.Object); 134await ((IResult)result).ExecuteAsync(httpContext.Object); 159await ((IResult)result).ExecuteAsync(httpContext.Object);
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiGenerator.cs (1)
107if (typeof(IResult).IsAssignableFrom(responseType))
Microsoft.AspNetCore.Routing (1)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
15if (obj is IResult result)
MinimalFormSample (1)
Program.cs (1)
60var result = Results.Ok(new Todo(name, isCompleted, dueDate));
MinimalSample (1)
Program.cs (1)
70app.MapGet("/null-result", IResult () => null!);
TestProject.IntegrationServiceA (3)
Postgres\NpgsqlEFCoreExtensions.cs (1)
13private static IResult VerifyNpgsqlEFCoreAsync(NpgsqlDbContext dbContext)
Postgres\PostgresExtensions.cs (1)
13private static async Task<IResult> VerifyPostgresAsync(NpgsqlConnection connection)
Redis\RedisExtensions.cs (1)
13private static async Task<IResult> VerifyRedisAsync([FromKeyedServices("redis")] IConnectionMultiplexer cm)