摘要: 1.前序遍历 图1 对于当前节点,先输出该节点,然后输出他的左孩子,最后输出他的右孩子。以上图为例,递归的过程如下: (1):输出 1,接着左孩子; (2):输出 2,接着左孩子; (3):输出 4,左孩子为空,再接着右孩子; (4):输出 6,左孩子为空,再接着右孩子; (5):输出 7,左右孩子 阅读全文
posted @ 2020-03-13 13:18 王大师123 阅读(955) 评论(0) 推荐(0) 编辑
摘要: .net core 异常过滤器的使用 CustomExceptionFilterAttribute.cs public class CustomExceptionFilterAttribute : ExceptionFilterAttribute { private readonly ILogger 阅读全文
posted @ 2020-03-09 15:10 王大师123 阅读(2281) 评论(0) 推荐(2) 编辑
摘要: 1.配置文件 { "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "wizards": [ { 阅读全文
posted @ 2020-03-05 14:36 王大师123 阅读(1744) 评论(0) 推荐(0) 编辑
摘要: 1.NuGet包: log4net.AspNetCore Microsoft.Extensions.Logging.Log4Net.AspNetCore 添加配置文件 log4net.config <?xml version="1.0" encoding="utf-8"?> <log4net> <! 阅读全文
posted @ 2020-03-05 14:04 王大师123 阅读(2129) 评论(0) 推荐(1) 编辑
摘要: 1.服务器安装aspnetcore-runtime 下载链接:https://dotnet.microsoft.com/download/dotnet-core/3.1 2.安装dotnet-hosting 下载地址:当前 .NET Core 托管捆绑包安装程序(直接下载) https://www. 阅读全文
posted @ 2020-03-03 13:46 王大师123 阅读(6368) 评论(1) 推荐(0) 编辑
摘要: //延时加载 public class EFQueryAdvancedTest { public static void Show() { IQueryable<Llogin> sources = null; using (CodeFirst dbContext = new CodeFirst()) 阅读全文
posted @ 2020-02-25 17:29 王大师123 阅读(250) 评论(0) 推荐(0) 编辑
摘要: //EntityState 四种状态 //1.Detached 实体跟上下文没有关系 //2.Detached 监听中 但是无修改 //3.Added 插入数据 //4.Modified 更新数据 //5.MDeleted 删除数据 public class EFStateTest { public 阅读全文
posted @ 2020-02-25 17:22 王大师123 阅读(1210) 评论(0) 推荐(0) 编辑
摘要: /// EF查看SQL2种方式 /// 1. 通过数据库的sqlprofiler /// 2. context.Database.Log += s => Console.WriteLine($"当前执行sql:{s}"); using (CodeFirst context = new CodeFir 阅读全文
posted @ 2020-02-21 18:20 王大师123 阅读(526) 评论(0) 推荐(0) 编辑
摘要: 当使用语句还原数据库时,报如下错误: 消息 3234,级别 16,状态 2,第 29 行逻辑文件 'LenborMealOrder_Base_2017' 不是数据库 'Members_01' 的一部分。请使用 RESTORE FILELISTONLY 来列出逻辑文件名。消息 3013,级别 16,状 阅读全文
posted @ 2020-02-17 13:15 王大师123 阅读(534) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { //AwaitAsyncClass.NoReturnNoAwait(); //AwaitAsyncClass.NoReturn(); //{ // Task t = AwaitAsyncClass.N 阅读全文
posted @ 2020-02-05 20:39 王大师123 阅读(159) 评论(0) 推荐(0) 编辑