{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# 使用 ASP.NET Croe WebApi" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 添加 Nuget 包" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [ { "data": { "text/html": [ "
Restore sources
Installed Packages
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Loading extension script from `C:\\Users\\ruyu\\.nuget\\packages\\microsoft.dotnet.interactive.aspnetcore\\1.0.0-beta.24229.4\\interactive-extensions\\dotnet\\extension.dib`" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "// 可以先添加包源\n", "#i \"https://api.nuget.org/v3/index.json\"\n", "\n", "//添加 Nuget 包\n", "#r \"nuget: microsoft.dotNet.interactive.aspnetcore,*-*\"" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 使用端点,放出API" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [ { "data": { "text/html": [ "

Request


GET http://127.0.0.1:4230/ HTTP/1.1

Headers
NameValue
traceparent00-9f30dd383da7da9695452942910e5eeb-9074df5bcf652253-00
Body (0 bytes)

Response


HTTP/1.1 200 OK ( ms)

Headers
NameValue
DateSun, 05 May 2024 16:42:55 GMT
ServerKestrel
Transfer-Encodingchunked
Content-Length18
Body (18 bytes)Hello from MapGet!
" ], "text/plain": [ "Request Method: GET\r\n", "Request URI: http://127.0.0.1:4230/\r\n", "Request Version: HTTP/1.1\r\n", "\r\n", "Status Code: 200 OK\r\n", "Elapsed: ms\r\n", "Version: HTTP/1.1\r\n", "Content Type: \r\n", "Content Length: 18 bytes\r\n", "\r\n", "Date: Sun, 05 May 2024 16:42:55 GMT\r\n", "Server: Kestrel\r\n", "Transfer-Encoding: chunked\r\n", "Content-Length: 18\r\n", "Body: Hello from MapGet!\r\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#!aspnet\n", "\n", "//引入之后就会暴露 aspnetcore 的东西,比如 App Endpoints WebApplication 等等,可以使用\n", "\n", "Endpoints.MapGet(\"/\", async context =>\n", "{\n", " await context.Response.WriteAsync($\"Hello from MapGet!\");\n", "});\n", "\n", "var responseMessage1 = await HttpClient.GetAsync(\"/\");\n", "\n", "responseMessage1.Display();" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [], "source": [ "#!aspnet\n", "\n", "Endpoints.MapGet(\"/\", async context =>\n", "{\n", " await context.Response.WriteAsync($\"Hello from MapGet!\");\n", "});\n", "\n", "Endpoints.MapInteractive(\"/\", async context =>\n", "{\n", " await context.Response.WriteAsync($\"Hello from MapInteractive!\");\n", "});\n", "\n", "Endpoints.MapInteractive(\"/\", async context =>\n", "{\n", " await context.Response.WriteAsync($\"Hello from MapInteractive 2!\");\n", "});\n", "\n", "var responseMessage2 = await HttpClient.GetAsync(\"/\");\n", "\n", "responseMessage2.Display();" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [], "source": [ "#!aspnet\n", "//using Microsoft.DotNet.Interactive.AspNetCore;\n", "\n", "App.Use(next =>\n", "{\n", " return async httpContext =>\n", " {\n", " await httpContext.Response.WriteAsync(\"Hello from middleware!\");\n", " };\n", "});\n", "\n", "var responseMessage3 = await HttpClient.GetAsync(\"/\");\n", "responseMessage3.Display();\n", "\n", "var responseBody3 = await responseMessage3.Content.ReadAsStringAsync();\n", "responseBody3.Display();" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [], "source": [ "#!aspnet\n", "\n", "App.Use(next =>\n", "{\n", " return async httpContext =>\n", " {\n", " await httpContext.Response.WriteAsync(\"Hello from middleware!\");\n", " };\n", "});\n", "\n", "Endpoints.MapGet(\"/\", async context =>\n", "{\n", " await context.Response.WriteAsync($\"Hello from MapGet!\");\n", "});\n", "\n", "var responseMessage4 = await HttpClient.GetAsync(\"/\");\n", "responseMessage4.Display();\n", "\n", "var responseBody4 = await responseMessage3.Content.ReadAsStringAsync();\n", "responseBody4.Display();\n", "\n", "App.Use(next =>\n", "{\n", " return async httpContext =>\n", " {\n", " await httpContext.Response.WriteAsync(\"Hello from middleware!\");\n", " };\n", "});\n", "\n", "var responseMessage2 = await HttpClient.GetAsync(\"/\");\n", "responseMessage2.Display();" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [ { "data": { "text/html": [ "

Request


GET http://127.0.0.1:4230/ HTTP/1.1

Headers
NameValue
traceparent00-9f30dd383da7da9695452942910e5eeb-f3d20b96fdaaa199-00
Body (0 bytes)

Response


HTTP/1.1 500 Internal Server Error ( ms)

Headers
NameValue
DateSun, 05 May 2024 16:43:07 GMT
ServerKestrel
Content-Length0
Body (0 bytes)
" ], "text/plain": [ "Request Method: GET\r\n", "Request URI: http://127.0.0.1:4230/\r\n", "Request Version: HTTP/1.1\r\n", "\r\n", "Status Code: 500 Internal Server Error\r\n", "Elapsed: ms\r\n", "Version: HTTP/1.1\r\n", "Content Type: \r\n", "Content Length: 0 bytes\r\n", "\r\n", "Date: Sun, 05 May 2024 16:43:07 GMT\r\n", "Server: Kestrel\r\n", "Content-Length: 0\r\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#!aspnet\n", "\n", "Endpoints.MapGet(\"/\", async context =>\n", "{\n", " await context.Response.WriteAsync($\"Hello from MapGet!\");\n", "});\n", "\n", "await HttpClient.GetAsync(\"/\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [ { "data": { "text/html": [ "

Request


GET http://127.0.0.1:4230/ HTTP/1.1

Headers
NameValue
traceparent00-9f30dd383da7da9695452942910e5eeb-a79a9b38cdb6229a-00
Body (0 bytes)

Response


HTTP/1.1 500 Internal Server Error ( ms)

Headers
NameValue
DateSun, 05 May 2024 16:43:27 GMT
ServerKestrel
Content-Length0
Body (0 bytes)
" ], "text/plain": [ "Request Method: GET\r\n", "Request URI: http://127.0.0.1:4230/\r\n", "Request Version: HTTP/1.1\r\n", "\r\n", "Status Code: 500 Internal Server Error\r\n", "Elapsed: ms\r\n", "Version: HTTP/1.1\r\n", "Content Type: \r\n", "Content Length: 0 bytes\r\n", "\r\n", "Date: Sun, 05 May 2024 16:43:27 GMT\r\n", "Server: Kestrel\r\n", "Content-Length: 0\r\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#!aspnet\n", "Endpoints.MapGet(\"/\", async context =>\n", "{\n", " await context.Response.WriteAsync($\"Hello from MapGet!\");\n", "});\n", "\n", "await HttpClient.GetAsync(\"/\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [ { "data": { "text/html": [ "
http://127.0.0.1:4230/
AbsolutePath
/
AbsoluteUri
http://127.0.0.1:4230/
LocalPath
/
Authority
127.0.0.1:4230
HostNameTypeIPv4
IsDefaultPort
False
IsFile
False
IsLoopback
True
PathAndQuery
/
Segments
[ / ]
IsUnc
False
Host
127.0.0.1
Port
4230
Query
Fragment
Scheme
http
OriginalString
http://127.0.0.1:4230
DnsSafeHost
127.0.0.1
IdnHost
127.0.0.1
IsAbsoluteUri
True
UserEscaped
False
UserInfo
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#!aspnet\n", "\n", "HttpClient.BaseAddress" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [ { "data": { "text/html": [ "
Microsoft.AspNetCore.Builder.ApplicationBuilder
ApplicationServices
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScopeTrue
ServiceProviderMicrosoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
ServerFeatures
[ [Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature] ]
Revision
1
IsReadOnly
False
(values)
indexvalue
0
[Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature]
KeyMicrosoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature
Value
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature
InternalCollection
[ http://127.0.0.1:4230 ]
PublicCollection
[ http://127.0.0.1:4230 ]
IsReadOnly
False
Count
1
(values)
[ http://127.0.0.1:4230 ]
PreferHostingUrls
False
Properties
keytypevalue
application.Services
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScopeTrue
ServiceProviderMicrosoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
server.Features
Microsoft.AspNetCore.Http.Features.FeatureCollection
[ [Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature] ]
Revision
1
IsReadOnly
False
(values)
indexvalue
0
[Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature]
KeyMicrosoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature
Value
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature
InternalCollection
[ http://127.0.0.1:4230 ]
PublicCollection[ http://127.0.0.1:4230 ]
IsReadOnlyFalse
Count1
(values)
[ http://127.0.0.1:4230 ]
PreferHostingUrls
False
__EndpointRouteBuilder
Microsoft.AspNetCore.Routing.DefaultEndpointRouteBuilder
Microsoft.AspNetCore.Routing.DefaultEndpointRouteBuilder
ApplicationBuilder
Microsoft.AspNetCore.Builder.ApplicationBuilder
ApplicationServices
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScopeTrue
ServiceProviderMicrosoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
ServerFeatures
[ [Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature] ]
Revision
1
IsReadOnly
False
(values)
indexvalue
0
[Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature]
KeyMicrosoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature
ValueMicrosoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature
Properties
keytypevalue
application.Services
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScopeTrue
ServiceProviderMicrosoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
server.Features
Microsoft.AspNetCore.Http.Features.FeatureCollection
[ [Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature] ]
Revision1
IsReadOnlyFalse
(values)
indexvalue
0[Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.ServerAddressesFeature]
__EndpointRouteBuilder
Microsoft.AspNetCore.Routing.DefaultEndpointRouteBuilder
Microsoft.AspNetCore.Routing.DefaultEndpointRouteBuilder
ApplicationBuilderMicrosoft.AspNetCore.Builder.ApplicationBuilder
DataSources[ Microsoft.AspNetCore.Routing.RouteEndpointDataSource ]
ServiceProviderMicrosoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
__UseRouting
System.Func<Microsoft.AspNetCore.Builder.IApplicationBuilder,Microsoft.AspNetCore.Builder.IApplicationBuilder>
System.Func`2[Microsoft.AspNetCore.Builder.IApplicationBuilder,Microsoft.AspNetCore.Builder.IApplicationBuilder]
Target
<null>
MethodMicrosoft.AspNetCore.Builder.IApplicationBuilder UseRouting(Microsoft.AspNetCore.Builder.IApplicationBuilder)
DataSources
indexvalue
0
Microsoft.AspNetCore.Routing.RouteEndpointDataSource
Endpoints
Microsoft.AspNetCore.Routing.RouteEndpointDataSource
Endpoints
Microsoft.AspNetCore.Routing.RouteEndpointDataSource
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScope
True
ServiceProvider
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
IsRootScopeTrue
ServiceProviderMicrosoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope
__UseRouting
System.Func<Microsoft.AspNetCore.Builder.IApplicationBuilder,Microsoft.AspNetCore.Builder.IApplicationBuilder>
System.Func`2[Microsoft.AspNetCore.Builder.IApplicationBuilder,Microsoft.AspNetCore.Builder.IApplicationBuilder]
Target
<null>
Method
Microsoft.AspNetCore.Builder.IApplicationBuilder UseRouting(Microsoft.AspNetCore.Builder.IApplicationBuilder)
Name
UseRouting
DeclaringTypeMicrosoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions
ReflectedTypeMicrosoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions
MemberTypeMethod
MetadataToken
100663382
Module
Microsoft.AspNetCore.Routing.dll
MDStreamVersion
131072
FullyQualifiedName
C:\\Program Files\\dotnet\\shared\\Microsoft.AspNetCore.App\\8.0.4\\Microsoft.AspNetCore.Routing.dll
ModuleVersionId
6c078444-7365-4d36-a723-507bbed36e5f
MetadataToken
1
ScopeName
Microsoft.AspNetCore.Routing.dll
Name
Microsoft.AspNetCore.Routing.dll
Assembly
Microsoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
CodeBasefile:///C:/Program Files/dotnet/shared/Microsoft.AspNetCore.App/8.0.4/Microsoft.AspNetCore.Routing.dll
FullNameMicrosoft.AspNetCore.Routing, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
EntryPoint
<null>
DefinedTypes[ HttpExtensions, System.Text.RegularExpressions.Generated.F74B1AE921BCEFE4BA601AA541C7A23B1CA9711EA81E8FE504B5B6446748E035A__GetAlphaRouteRegex_0, System.Text.RegularExpressions.Generated.F74B1AE921BCEFE4BA601AA541C7A23B1CA9711EA81E8FE504B5B6446748E035A__Utilities, System.Runtime.CompilerServices.TypeHelper, Microsoft.Net.Http.Headers.HttpRuleParser, Microsoft.Net.Http.Headers.HttpParseResult, Microsoft.Extensions.Internal.PropertyHelper, Microsoft.Extensions.DependencyInjection.ConfigureRouteOptions, Microsoft.Extensions.DependencyInjection.RoutingServiceCollectionExtensions, Microsoft.Extensions.DependencyInjection.RegexInlineRouteConstraintSetup, Microsoft.AspNetCore.Shared.DebuggerHelpers, Microsoft.AspNetCore.Internal.ExecuteHandlerHelper, Microsoft.AspNetCore.Internal.RouteValueDictionaryTrimmerWarning, Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions, Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions, Microsoft.AspNetCore.Builder.FallbackEndpointRouteBuilderExtensions, Microsoft.AspNetCore.Builder.RouteHandlerBuilder, Microsoft.AspNetCore.Builder.RoutingBuilderExtensions, Microsoft.AspNetCore.Builder.RoutingEndpointConventionBuilderExtensions, Microsoft.AspNetCore.Builder.MapRouteRouteBuilderExtensions ... (341 more) ]
IsCollectibleFalse
ManifestModuleMicrosoft.AspNetCore.Routing.dll
ReflectionOnlyFalse
LocationC:\\Program Files\\dotnet\\shared\\Microsoft.AspNetCore.App\\8.0.4\\Microsoft.AspNetCore.Routing.dll
ImageRuntimeVersionv4.0.30319
GlobalAssemblyCacheFalse
HostContext0
IsDynamicFalse
ExportedTypes[ Microsoft.Extensions.DependencyInjection.RoutingServiceCollectionExtensions, Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions, Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions, Microsoft.AspNetCore.Builder.FallbackEndpointRouteBuilderExtensions, Microsoft.AspNetCore.Builder.RouteHandlerBuilder, Microsoft.AspNetCore.Builder.RoutingBuilderExtensions, Microsoft.AspNetCore.Builder.RoutingEndpointConventionBuilderExtensions, Microsoft.AspNetCore.Builder.MapRouteRouteBuilderExtensions, Microsoft.AspNetCore.Builder.RouterMiddleware, Microsoft.AspNetCore.Builder.RouteShortCircuitEndpointConventionBuilderExtensions, Microsoft.AspNetCore.Http.EndpointFilterExtensions, Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions, Microsoft.AspNetCore.Routing.RouteHandlerServices, Microsoft.AspNetCore.Routing.CompositeEndpointDataSource, Microsoft.AspNetCore.Routing.DataTokensMetadata, Microsoft.AspNetCore.Routing.DefaultEndpointDataSource, Microsoft.AspNetCore.Routing.DefaultInlineConstraintResolver, Microsoft.AspNetCore.Routing.EndpointDataSource, Microsoft.AspNetCore.Routing.EndpointGroupNameAttribute, Microsoft.AspNetCore.Routing.EndpointNameAttribute ... (118 more) ]
IsFullyTrustedTrue
CustomAttributes[ [System.Runtime.CompilerServices.ExtensionAttribute()], [System.Runtime.CompilerServices.CompilationRelaxationsAttribute((Int32)8)], [System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(WrapNonExceptionThrows = True)], [System.Diagnostics.DebuggableAttribute((System.Diagnostics.DebuggableAttribute+DebuggingModes)2)], [System.Reflection.Metadata.MetadataUpdateHandlerAttribute(typeof(Microsoft.Extensions.Internal.PropertyHelper+MetadataUpdateHandler))], [System.Runtime.Versioning.TargetFrameworkAttribute(\".NETCoreApp,Version=v8.0\", FrameworkDisplayName = \".NET 8.0\")], [System.Runtime.CompilerServices.InternalsVisibleToAttribute(\"Microsoft.AspNetCore.OpenApi.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb\")], [System.Runtime.CompilerServices.InternalsVisibleToAttribute(\"Microsoft.AspNetCore.Routing.Microbenchmarks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb\")], [System.Runtime.CompilerServices.InternalsVisibleToAttribute(\"Microsoft.AspNetCore.Routing.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb\")], [System.Runtime.CompilerServices.InternalsVisibleToAttribute(\"Microsoft.AspNetCore.Mvc.ApiExplorer.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb\")], [System.Runtime.CompilerServices.InternalsVisibleToAttribute(\"DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7\")], [System.Runtime.CompilerServices.InternalsVisibleToAttribute(\"Microsoft.AspNetCore.Mvc.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb\")], [System.Reflection.AssemblyMetadataAttribute(\"IsTrimmable\", \"True\")], [System.Reflection.AssemblyMetadataAttribute(\"CommitHash\", \"8486d31e24f30e3fa1809a95699a0adc16f448d7\")], [System.Reflection.AssemblyMetadataAttribute(\"SourceCommitUrl\", \"https://github.com/dotnet/aspnetcore/tree/8486d31e24f30e3fa1809a95699a0adc16f448d7\")], [System.Reflection.AssemblyMetadataAttribute(\"Serviceable\", \"True\")], [System.Reflection.AssemblyCompanyAttribute(\"Microsoft Corporation\")], [System.Reflection.AssemblyConfigurationAttribute(\"Release\")], [System.Reflection.AssemblyCopyrightAttribute(\"© Microsoft Corporation. All rights reserved.\")], [System.Reflection.AssemblyDescriptionAttribute(\"\r\n", " ASP.NET Core middleware for routing requests to application logic and for generating links.\r\n", " Commonly used types:\r\n", " Microsoft.AspNetCore.Routing.Route\r\n", " Microsoft.AspNetCore.Routing.RouteCollection\r\n", " \")] ... (6 more) ]
EscapedCodeBasefile:///C:/Program%20Files/dotnet/shared/Microsoft.AspNetCore.App/8.0.4/Microsoft.AspNetCore.Routing.dll
Modules[ Microsoft.AspNetCore.Routing.dll ]
SecurityRuleSetNone
ModuleHandle
System.ModuleHandle
MDStreamVersion131072
CustomAttributes
indexvalue
0[System.Security.UnverifiableCodeAttribute()]
1[System.Runtime.CompilerServices.RefSafetyRulesAttribute((Int32)11)]
2[System.Runtime.CompilerServices.NullablePublicOnlyAttribute((Boolean)True)]
IsSecurityCritical
True
IsSecuritySafeCritical
False
IsSecurityTransparent
False
MethodHandle
System.RuntimeMethodHandle
Value
140713067293856
AttributesPublic, Static, HideBySig
CallingConventionStandard
ReturnTypeMicrosoft.AspNetCore.Builder.IApplicationBuilder
ReturnTypeCustomAttributes
Microsoft.AspNetCore.Builder.IApplicationBuilder
ParameterTypeMicrosoft.AspNetCore.Builder.IApplicationBuilder
Name
<null>
HasDefaultValue
False
DefaultValue
RawDefaultValue
MetadataToken
134217728
AttributesNone
Member
Microsoft.AspNetCore.Builder.IApplicationBuilder UseRouting(Microsoft.AspNetCore.Builder.IApplicationBuilder)
NameUseRouting
DeclaringTypeMicrosoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions
ReflectedTypeMicrosoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions
MemberTypeMethod
MetadataToken100663382
ModuleMicrosoft.AspNetCore.Routing.dll
IsSecurityCriticalTrue
IsSecuritySafeCriticalFalse
IsSecurityTransparentFalse
MethodHandleSystem.RuntimeMethodHandle
AttributesPublic, Static, HideBySig
CallingConventionStandard
ReturnTypeMicrosoft.AspNetCore.Builder.IApplicationBuilder
ReturnTypeCustomAttributesMicrosoft.AspNetCore.Builder.IApplicationBuilder
ReturnParameterMicrosoft.AspNetCore.Builder.IApplicationBuilder
IsCollectibleFalse
IsGenericMethodFalse
IsGenericMethodDefinitionFalse
ContainsGenericParametersFalse
MethodImplementationFlagsIL
IsAbstractFalse
IsConstructorFalse
IsFinalFalse
IsHideBySigTrue
IsSpecialNameFalse
IsStaticTrue
IsVirtualFalse
IsAssemblyFalse
IsFamilyFalse
IsFamilyAndAssemblyFalse
IsFamilyOrAssemblyFalse
IsPrivateFalse
IsPublicTrue
IsConstructedGenericMethodFalse
CustomAttributes[ [System.Runtime.CompilerServices.ExtensionAttribute()] ]
Position
-1
IsIn
False
IsLcid
False
IsOptional
False
IsOut
False
IsRetval
False
CustomAttributes(empty)
ReturnParameter
Microsoft.AspNetCore.Builder.IApplicationBuilder
ParameterTypeMicrosoft.AspNetCore.Builder.IApplicationBuilder
Name
<null>
HasDefaultValue
False
DefaultValue
RawDefaultValue
MetadataToken
134217728
AttributesNone
Member
Microsoft.AspNetCore.Builder.IApplicationBuilder UseRouting(Microsoft.AspNetCore.Builder.IApplicationBuilder)
NameUseRouting
DeclaringTypeMicrosoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions
ReflectedTypeMicrosoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions
MemberTypeMethod
MetadataToken100663382
ModuleMicrosoft.AspNetCore.Routing.dll
IsSecurityCriticalTrue
IsSecuritySafeCriticalFalse
IsSecurityTransparentFalse
MethodHandleSystem.RuntimeMethodHandle
AttributesPublic, Static, HideBySig
CallingConventionStandard
ReturnTypeMicrosoft.AspNetCore.Builder.IApplicationBuilder
ReturnTypeCustomAttributesMicrosoft.AspNetCore.Builder.IApplicationBuilder
ReturnParameterMicrosoft.AspNetCore.Builder.IApplicationBuilder
IsCollectibleFalse
IsGenericMethodFalse
IsGenericMethodDefinitionFalse
ContainsGenericParametersFalse
MethodImplementationFlagsIL
IsAbstractFalse
IsConstructorFalse
IsFinalFalse
IsHideBySigTrue
IsSpecialNameFalse
IsStaticTrue
IsVirtualFalse
IsAssemblyFalse
IsFamilyFalse
IsFamilyAndAssemblyFalse
IsFamilyOrAssemblyFalse
IsPrivateFalse
IsPublicTrue
IsConstructedGenericMethodFalse
CustomAttributes[ [System.Runtime.CompilerServices.ExtensionAttribute()] ]
Position
-1
IsIn
False
IsLcid
False
IsOptional
False
IsOut
False
IsRetval
False
CustomAttributes(empty)
IsCollectible
False
IsGenericMethod
False
IsGenericMethodDefinition
False
ContainsGenericParameters
False
MethodImplementationFlagsIL
IsAbstract
False
IsConstructor
False
IsFinal
False
IsHideBySig
True
IsSpecialName
False
IsStatic
True
IsVirtual
False
IsAssembly
False
IsFamily
False
IsFamilyAndAssembly
False
IsFamilyOrAssembly
False
IsPrivate
False
IsPublic
True
IsConstructedGenericMethod
False
CustomAttributes
indexvalue
0
[System.Runtime.CompilerServices.ExtensionAttribute()]
ConstructorVoid .ctor()
ConstructorArguments[ ]
NamedArguments[ ]
AttributeTypeSystem.Runtime.CompilerServices.ExtensionAttribute
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#!aspnet\n", "\n", "App.Display()" ] } ], "metadata": { "kernelspec": { "display_name": ".NET (C#)", "language": "C#", "name": ".net-csharp" }, "language_info": { "name": "polyglot-notebook" }, "orig_nbformat": 4, "polyglot_notebook": { "kernelInfo": { "defaultKernelName": "csharp", "items": [ { "aliases": [], "name": "csharp" }, { "aliases": [], "name": "razor" } ] } } }, "nbformat": 4, "nbformat_minor": 2 }