摘要:
通过DefaultActionDescriptorCollectionProvider类,我们获取到了应用的Controller和Action相关信息 后面分析Action是如何执行的 通过IActionSelector找到对应的ActionDescriptor 然后调用IActionInvoker 阅读全文
posted @ 2020-04-06 17:08
蓝平凡
阅读(480)
评论(0)
推荐(0)
摘要:
创建完ApplicationModel后,调用ControllerActionDescriptorBuilder类的Build方法创建对应的ControllerActionDescriptor internal static class ControllerActionDescriptorBuild 阅读全文
posted @ 2020-04-06 16:54
蓝平凡
阅读(415)
评论(0)
推荐(0)
摘要:
AuthorizationApplicationModelProvider 该类主要添加授权认证的过滤器 先在Controller和Action中找到实现IAuthorizeData的特性,再根据IAuthorizeData创建AuthorizeFilter过滤器,把AuthorizeFilter添 阅读全文
posted @ 2020-04-06 16:44
蓝平凡
阅读(413)
评论(0)
推荐(0)
摘要:
前面讲到ApplicationModel对象,那接下来看看ApplicationModel /// <summary> /// A model for configuring controllers in an MVC application. /// </summary> [DebuggerDis 阅读全文
posted @ 2020-04-06 16:18
蓝平凡
阅读(580)
评论(0)
推荐(0)
摘要:
看下应用如何构建出对应的ActionDescriptor DefaultActionDescriptorCollectionProvider internal class DefaultActionDescriptorCollectionProvider : ActionDescriptorColl 阅读全文
posted @ 2020-04-06 15:56
蓝平凡
阅读(502)
评论(0)
推荐(0)
摘要:
我们先看下IApplicationBuilder接口的扩展方法UseMvc public static IApplicationBuilder UseMvc( this IApplicationBuilder app, Action<IRouteBuilder> configureRoutes) { 阅读全文
posted @ 2020-04-06 15:09
蓝平凡
阅读(1187)
评论(0)
推荐(0)
摘要:
public class KestrelServer : IServer { private readonly List<(IConnectionListener, Task)> _transports = new List<(IConnectionListener, Task)>(); priva 阅读全文
posted @ 2020-04-06 11:59
蓝平凡
阅读(1405)
评论(0)
推荐(0)
摘要:
EndpointRoute新的路由方案 public static class EndpointRoutingApplicationBuilderExtensions { private const string EndpointRouteBuilder = "__EndpointRouteBuil 阅读全文
posted @ 2020-04-06 11:30
蓝平凡
阅读(1102)
评论(0)
推荐(2)
摘要:
先看下IApplicationBuilder的扩展方法 public static IApplicationBuilder UseRouter(this IApplicationBuilder builder, IRouter router) { if (builder == null) { thr 阅读全文
posted @ 2020-04-06 11:16
蓝平凡
阅读(1321)
评论(0)
推荐(0)
摘要:
一、IFeatureCollection 表示Http特性的集合,该集合存放一些http相关特性,如IHttpRequestFeature、IHttpResponseFeature 当构建HttpContext、HttpRequest、HttpResponse对象时,会从这些特性里面解析构建对应的类 阅读全文
posted @ 2020-04-06 10:45
蓝平凡
阅读(728)
评论(0)
推荐(0)
摘要:
一、IApplicationBuilderFactory public interface IApplicationBuilderFactory { IApplicationBuilder CreateBuilder(IFeatureCollection serverFeatures); } pub 阅读全文
posted @ 2020-04-06 10:05
蓝平凡
阅读(658)
评论(0)
推荐(0)
摘要:
先看下如下的扩展方法 public static class GenericHostWebHostBuilderExtensions { public static IHostBuilder ConfigureWebHost(this IHostBuilder builder, Action<IWe 阅读全文
posted @ 2020-04-06 09:57
蓝平凡
阅读(955)
评论(0)
推荐(0)
浙公网安备 33010602011771号