上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: 一、IApplicationBuilderFactory public interface IApplicationBuilderFactory { IApplicationBuilder CreateBuilder(IFeatureCollection serverFeatures); } pub 阅读全文
posted @ 2020-04-06 10:05 蓝平凡 阅读(646) 评论(0) 推荐(0) 编辑
摘要: 先看下如下的扩展方法 public static class GenericHostWebHostBuilderExtensions { public static IHostBuilder ConfigureWebHost(this IHostBuilder builder, Action<IWe 阅读全文
posted @ 2020-04-06 09:57 蓝平凡 阅读(920) 评论(0) 推荐(0) 编辑
摘要: IWebHost实现类WebHost internal class WebHost : IWebHost, IAsyncDisposable { private static readonly string DeprecatedServerUrlsKey = "server.urls"; priva 阅读全文
posted @ 2020-03-25 09:56 蓝平凡 阅读(777) 评论(0) 推荐(0) 编辑
摘要: WebHost主机 /// <summary> /// A builder for <see cref="IWebHost"/> /// </summary> public class WebHostBuilder : IWebHostBuilder { private readonly Hosti 阅读全文
posted @ 2020-03-24 17:32 蓝平凡 阅读(1866) 评论(0) 推荐(0) 编辑
摘要: 上一篇我们分析了IHostBuilder如何创建IHost的,这篇我们具体介绍下IHost的实现类Host internal class Host : IHost, IAsyncDisposable { private readonly ILogger<Host> _logger; private 阅读全文
posted @ 2020-03-24 13:45 蓝平凡 阅读(446) 评论(0) 推荐(0) 编辑
摘要: Nuget包:以Microsoft.Extensins.Hosting开头的Nuget包 Github地址:https://github.com/dotnet/extensions/tree/master/src/Hosting 先看下几个重要的接口 IHostBuilder的实现类HostBuil 阅读全文
posted @ 2020-03-23 10:34 蓝平凡 阅读(1033) 评论(0) 推荐(0) 编辑
摘要: 上篇介绍了netcore里面的几个日志提供器 我们看下如何简单的使用: var services = new ServiceCollection(); services.AddLogging(builder => { builder.AddConsole(); }); var provider = 阅读全文
posted @ 2020-03-21 18:29 蓝平凡 阅读(807) 评论(0) 推荐(0) 编辑
摘要: 上一篇介绍了netcore的日志系统,接下来看下netcore里面提供了哪写日志功能: 一、 DebugLogger /// <summary> /// A logger that writes messages in the debug output window only when a debu 阅读全文
posted @ 2020-03-21 18:20 蓝平凡 阅读(570) 评论(0) 推荐(0) 编辑
摘要: nuget包:以Microsoft.Extensins.Logging开头的nuget包 Github地址:https://github.com/dotnet/extensions/tree/master/src/Logging Logging的依赖注入: public static class L 阅读全文
posted @ 2020-03-21 18:16 蓝平凡 阅读(1106) 评论(0) 推荐(0) 编辑
摘要: 上篇主要介绍IOptions的原理,这篇看下如何使用 定义选项: public class MyOption { public string Name { get; set; } public int Score { get; set; } } class Program { static void 阅读全文
posted @ 2020-03-21 17:55 蓝平凡 阅读(686) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 12 下一页