70 implementations of IResult
Aspire.Dashboard (1)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Http.Abstractions (1)
Microsoft.AspNetCore.Http.Microbenchmarks (5)
Microsoft.AspNetCore.Http.Results (45)
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
Microsoft.AspNetCore.Http.Results.Tests (8)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.Mvc.Core.Test (4)
Microsoft.AspNetCore.Routing.Tests (1)
Sample (1)
358 references to IResult
AzureFunctionsEndToEnd.Functions (1)
BasicWebSite (2)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.Components.Endpoints (2)
Microsoft.AspNetCore.Http.Abstractions (5)
Microsoft.AspNetCore.Http.Extensions (12)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.Results (222)
Results.cs (136)
23/// A factory for <see cref="IResult"/>.
28/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ChallengeAsync(HttpContext, string?, AuthenticationProperties?)" />.
38/// <returns>The created <see cref="IResult"/> for the response.</returns>
39public static IResult Challenge(
45/// Creates a <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ForbidAsync(HttpContext, string?, AuthenticationProperties?)"/>.
54/// <returns>The created <see cref="IResult"/> for the response.</returns>
59public static IResult Forbid(AuthenticationProperties? properties = null, IList<string>? authenticationSchemes = null)
63/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignInAsync(HttpContext, string?, ClaimsPrincipal, AuthenticationProperties?)" />.
68/// <returns>The created <see cref="IResult"/> for the response.</returns>
69public static IResult SignIn(
76/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignOutAsync(HttpContext, string?, AuthenticationProperties?)" />.
80/// <returns>The created <see cref="IResult"/> for the response.</returns>
81public static IResult SignOut(AuthenticationProperties? properties = null, IList<string>? authenticationSchemes = null)
93/// <returns>The created <see cref="IResult"/> object for the response.</returns>
98public static IResult Content(string? content, string? contentType, Encoding? contentEncoding)
111/// <returns>The created <see cref="IResult"/> object for the response.</returns>
116public static IResult Content(string? content, string? contentType = null, Encoding? contentEncoding = null, int? statusCode = null)
128/// <returns>The created <see cref="IResult"/> object for the response.</returns>
133public static IResult Text(string? content, string? contentType, Encoding? contentEncoding)
146/// <returns>The created <see cref="IResult"/> object for the response.</returns>
151public static IResult Text(string? content, string? contentType = null, Encoding? contentEncoding = null, int? statusCode = null)
160/// <returns>The created <see cref="IResult"/> object for the response.</returns>
161public static IResult Text(ReadOnlySpan<byte> utf8Content, string? contentType = null, int? statusCode = null)
169/// <returns>The created <see cref="IResult"/> object for the response.</returns>
170public static IResult Content(string? content, MediaTypeHeaderValue contentType)
174/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON.
186public static IResult Json(object? data, JsonSerializerOptions? options = null, string? contentType = null, int? statusCode = null)
190/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON.
201public static IResult Json(object? data, JsonTypeInfo jsonTypeInfo, string? contentType = null, int? statusCode = null)
208/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON.
220public static IResult Json(object? data, Type type, JsonSerializerContext context, string? contentType = null, int? statusCode = null)
230/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON.
242public static IResult Json<TValue>(TValue? data, JsonSerializerOptions? options = null, string? contentType = null, int? statusCode = null)
247/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON.
258public static IResult Json<TValue>(TValue? data, JsonTypeInfo<TValue> jsonTypeInfo, string? contentType = null, int? statusCode = null)
263/// Creates a <see cref="IResult"/> that serializes the specified <paramref name="data"/> object to JSON.
274public static IResult Json<TValue>(TValue? data, JsonSerializerContext context, string? contentType = null, int? statusCode = null)
293/// <returns>The created <see cref="IResult"/> for the response.</returns>
294public static IResult File(
318/// <returns>The created <see cref="IResult"/> for the response.</returns>
319public static IResult Bytes(
341/// <returns>The created <see cref="IResult"/> for the response.</returns>
342public static IResult Bytes(
369/// <returns>The created <see cref="IResult"/> for the response.</returns>
373public static IResult File(
400/// <returns>The created <see cref="IResult"/> for the response.</returns>
404public static IResult Stream(
428/// <returns>The created <see cref="IResult"/> for the response.</returns>
432public static IResult Stream(
451/// <returns>The created <see cref="IResult"/> for the response.</returns>
452public static IResult Stream(
473/// <returns>The created <see cref="IResult"/> for the response.</returns>
474public static IResult File(
505/// <returns>The created <see cref="IResult"/> for the response.</returns>
506public static IResult Redirect([StringSyntax(StringSyntaxAttribute.Uri)] string url, bool permanent = false, bool preserveMethod = false)
529/// <returns>The created <see cref="IResult"/> for the response.</returns>
530public static IResult LocalRedirect([StringSyntax(StringSyntaxAttribute.Uri, UriKind.Relative)] string localUrl, bool permanent = false, bool preserveMethod = false)
555/// <returns>The created <see cref="IResult"/> for the response.</returns>
557public static IResult RedirectToRoute(string? routeName = null, object? routeValues = null, bool permanent = false, bool preserveMethod = false, string? fragment = null)
582/// <returns>The created <see cref="IResult"/> for the response.</returns>
584public static IResult RedirectToRoute(string? routeName, RouteValueDictionary? routeValues, bool permanent = false, bool preserveMethod = false, string? fragment = null)
589/// Creates an <see cref="IResult"/> object by specifying a <paramref name="statusCode"/>.
592/// <returns>The created <see cref="IResult"/> object for the response.</returns>
593public static IResult StatusCode(int statusCode)
600/// <returns>The created <see cref="IResult"/> for the response.</returns>
601public static IResult NotFound(object? value = null)
608/// <returns>The created <see cref="IResult"/> for the response.</returns>
609public static IResult NotFound<TValue>(TValue? value)
615/// <returns>The created <see cref="IResult"/> for the response.</returns>
616public static IResult Unauthorized()
623/// <returns>The created <see cref="IResult"/> for the response.</returns>
624public static IResult BadRequest(object? error = null)
631/// <returns>The created <see cref="IResult"/> for the response.</returns>
632public static IResult BadRequest<TValue>(TValue? error)
639/// <returns>The created <see cref="IResult"/> for the response.</returns>
640public static IResult Conflict(object? error = null)
647/// <returns>The created <see cref="IResult"/> for the response.</returns>
648public static IResult Conflict<TValue>(TValue? error)
654/// <returns>The created <see cref="IResult"/> for the response.</returns>
655public static IResult NoContent()
662/// <returns>The created <see cref="IResult"/> for the response.</returns>
663public static IResult Ok(object? value = null)
670/// <returns>The created <see cref="IResult"/> for the response.</returns>
671public static IResult Ok<TValue>(TValue? value)
678/// <returns>The created <see cref="IResult"/> for the response.</returns>
679public static IResult UnprocessableEntity(object? error = null)
686/// <returns>The created <see cref="IResult"/> for the response.</returns>
687public static IResult UnprocessableEntity<TValue>(TValue? error)
693/// <returns>The created <see cref="IResult"/> for the response.</returns>
694public static IResult InternalServerError()
701/// <returns>The created <see cref="IResult"/> for the response.</returns>
702public static IResult InternalServerError<TValue>(TValue? error)
714/// <returns>The created <see cref="IResult"/> for the response.</returns>
715public static IResult Problem(
733/// <returns>The created <see cref="IResult"/> for the response.</returns>
735public static IResult Problem(
749/// <returns>The created <see cref="IResult"/> for the response.</returns>
750public static IResult Problem(ProblemDetails problemDetails)
764/// <returns>The created <see cref="IResult"/> for the response.</returns>
765public static IResult ValidationProblem(
788/// <returns>The created <see cref="IResult"/> for the response.</returns>
790public static IResult ValidationProblem(
832/// <returns>The created <see cref="IResult"/> for the response.</returns>
833public static IResult Created()
841/// <returns>The created <see cref="IResult"/> for the response.</returns>
842public static IResult Created(string? uri, object? value)
850/// <returns>The created <see cref="IResult"/> for the response.</returns>
851public static IResult Created<TValue>(string? uri, TValue? value)
859/// <returns>The created <see cref="IResult"/> for the response.</returns>
860public static IResult Created(Uri? uri, object? value)
868/// <returns>The created <see cref="IResult"/> for the response.</returns>
869public static IResult Created<TValue>(Uri? uri, TValue? value)
878/// <returns>The created <see cref="IResult"/> for the response.</returns>
880public static IResult CreatedAtRoute(string? routeName = null, object? routeValues = null, object? value = null)
889/// <returns>The created <see cref="IResult"/> for the response.</returns>
891public static IResult CreatedAtRoute(string? routeName, RouteValueDictionary? routeValues, object? value = null)
901/// <returns>The created <see cref="IResult"/> for the response.</returns>
903public static IResult CreatedAtRoute<TValue>(string? routeName = null, object? routeValues = null, TValue? value = default)
912/// <returns>The created <see cref="IResult"/> for the response.</returns>
914public static IResult CreatedAtRoute<TValue>(string? routeName, RouteValueDictionary? routeValues, TValue? value = default)
923/// <returns>The created <see cref="IResult"/> for the response.</returns>
924public static IResult Accepted(string? uri = null, object? value = null)
932/// <returns>The created <see cref="IResult"/> for the response.</returns>
933public static IResult Accepted<TValue>(string? uri = null, TValue? value = default)
942/// <returns>The created <see cref="IResult"/> for the response.</returns>
944public static IResult AcceptedAtRoute(string? routeName = null, object? routeValues = null, object? value = null)
953/// <returns>The created <see cref="IResult"/> for the response.</returns>
955public static IResult AcceptedAtRoute(string? routeName, RouteValueDictionary? routeValues, object? value = null)
965/// <returns>The created <see cref="IResult"/> for the response.</returns>
967public static IResult AcceptedAtRoute<TValue>(string? routeName = null, object? routeValues = null, TValue? value = default)
976/// <returns>The created <see cref="IResult"/> for the response.</returns>
978public static IResult AcceptedAtRoute<TValue>(string? routeName, RouteValueDictionary? routeValues, TValue? value = default)
992public static IResult ServerSentEvents(IAsyncEnumerable<string> values, string? eventType = null)
1008public static IResult ServerSentEvents<T>(IAsyncEnumerable<T> values, string? eventType = null)
1022public static IResult ServerSentEvents<T>(IAsyncEnumerable<SseItem<T>> values)
1028public static IResult Empty => EmptyHttpResult.Instance;
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)
Microsoft.AspNetCore.Identity (2)
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
Microsoft.AspNetCore.Mvc.Core (10)
Microsoft.AspNetCore.Mvc.Core.Test (9)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.Routing (1)
Microsoft.Extensions.Validation.GeneratorTests (1)
MinimalFormSample (1)
Sample (53)
artifacts\obj\Sample\Release\net10.0\generated\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs (53)
84var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::System.String arg0) => throw null!);
126var result = handler(documentName_local!);
162var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::System.String arg0) => throw null!);
196var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0) => throw null!);
242var result = handler(resume_local!);
283var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0) => throw null!);
317var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFileCollection arg0) => throw null!);
363var result = handler(files_local!);
404var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFileCollection arg0) => throw null!);
439var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0, global::Microsoft.AspNetCore.Http.IFormFileCollection arg1) => throw null!);
494var result = handler(resume_local!, files_local!);
544var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0, global::Microsoft.AspNetCore.Http.IFormFileCollection arg1) => throw null!);
1005var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult () => throw null!);
1035var result = handler();
1061var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult () => throw null!);
2888var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ParentObject arg0) => throw null!);
2929var result = handler(parent_local!);
2963var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ParentObject arg0) => throw null!);
3011var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ChildObject arg0) => throw null!);
3052var result = handler(child_local!);
3086var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ChildObject arg0) => throw null!);
3137var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.JsonPatch.SystemTextJson.JsonPatchDocument arg0) => throw null!);
3178var result = handler(patchDoc_local!);
3212var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.JsonPatch.SystemTextJson.JsonPatchDocument arg0) => throw null!);
3263var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.JsonPatch.SystemTextJson.JsonPatchDocument<global::SchemasEndpointsExtensions.ParentObject> arg0) => throw null!);
3304var result = handler(patchDoc_local!);
3338var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.JsonPatch.SystemTextJson.JsonPatchDocument<global::SchemasEndpointsExtensions.ParentObject> arg0) => throw null!);
3472var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.Config arg0) => throw null!);
3513var result = handler(config_local!);
3547var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.Config arg0) => throw null!);
3595var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ProjectResponse arg0) => throw null!);
3636var result = handler(project_local!);
3670var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ProjectResponse arg0) => throw null!);
3718var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.Subscription arg0) => throw null!);
3759var result = handler(subscription_local!);
3793var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.Subscription arg0) => throw null!);
4013var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.NullableRequestModel? arg0) => throw null!);
4054var result = handler(request_local);
4088var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.NullableRequestModel? arg0) => throw null!);
4136var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ComplexHierarchyModel arg0) => throw null!);
4177var result = handler(model_local!);
4211var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.ComplexHierarchyModel arg0) => throw null!);
4259var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.NullableArrayModel arg0) => throw null!);
4300var result = handler(model_local!);
4334var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::SchemasEndpointsExtensions.NullableArrayModel arg0) => throw null!);
4681var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Todo arg0) => throw null!);
4722var result = handler(todo_local!);
4756var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Todo arg0) => throw null!);
4996var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult () => throw null!);
5026var result = handler();
5052var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult () => throw null!);
5820if (obj is IResult r)
5974private static Task ExecuteAsyncExplicit(IResult result, HttpContext httpContext)
TestProject.IntegrationServiceA (3)