• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
PowerCoder
博客园    首页    新随笔    联系   管理    订阅  订阅
01 2020 档案
How does SqlDataReader handle really large queries?(转载)

摘要:问 Actually I'm not sure the title accurately describes the question, but I hope it is close enough. I have some code that performs a SELECT from a dat 阅读全文
posted @ 2020-01-22 13:52 PowerCoder 阅读(253) 评论(0) 推荐(0)
ASP.NET Core MVC中的Filter如果不实现IFilterFactory接口,那么Filter默认情况下在ASP.NET Core生命周期内是单例的,会被重用

摘要:问 I have an AuthorizationFilter as follows: I found the constructor of AuthorizationFilter will just be called one time during the whole ASP.NET Core 阅读全文
posted @ 2020-01-20 16:37 PowerCoder 阅读(725) 评论(0) 推荐(0)
What is the use for Task.FromResult<TResult> in C#(转载)

摘要:问: In C# and TPL (Task Parallel Library), the Task class represents an ongoing work that produces a value of type T.I'd like to know what is the need 阅读全文
posted @ 2020-01-18 21:57 PowerCoder 阅读(414) 评论(0) 推荐(0)
await Task.Yield()和await Task.CompletedTask有什么不同

摘要:有时候我们在代码中要执行一些非常耗时的操作,我们不希望这些操作阻塞调用线程(主线程)的执行,因为调用线程(主线程)可能还有更重要的工作要做,我们希望将这些非常耗时的操作由另外一个线程去执行,这个时候就可以用到await Task.Yield(),它借助了C# 5.0中的异步函数关键字await as 阅读全文
posted @ 2020-01-16 15:28 PowerCoder 阅读(7224) 评论(0) 推荐(7)
Whats the benefit of passing a CancellationToken as a parameter to Task.Run?(转载)

摘要:问: Obviously I realize it enables me to cancel the task, but this code achieves the same effect without having to pass the token into Task.RunWhat is 阅读全文
posted @ 2020-01-14 19:02 PowerCoder 阅读(305) 评论(0) 推荐(0)
利用.NET Core中的Worker Service,来创建windows服务或linux守护程序

摘要:导航 开始创建worker service 项目 Program.cs Worker.cs 依赖注入(DI) 重写BackgroundService类的StartAsync、ExecuteAsync、StopAsync方法 不要让线程阻塞worker类中重写的StartAsync、ExecuteAs 阅读全文
posted @ 2020-01-14 11:36 PowerCoder 阅读(21060) 评论(17) 推荐(23)
玩转ASP.NET Core中的日志组件(链接)

摘要:一篇很不错的介绍了ASP.NET Core中日志组件的文章: 玩转ASP.NET Core中的日志组件 阅读全文
posted @ 2020-01-14 10:24 PowerCoder 阅读(862) 评论(0) 推荐(0)
C#: Thread.Sleep vs. Task.Delay (转载)

摘要:We can use both Thread.Sleep() and Task.Delay() to suspend the execution of a program (thread) for a given timespan. But are we actually suspending th 阅读全文
posted @ 2020-01-12 16:00 PowerCoder 阅读(2274) 评论(0) 推荐(2)
C#中如何使用异步lambda表达式来初始化委托实例

摘要:下面我们通过一个.NET Core控制台项目,来展示如何使用异步lambda表达式来初始化三种委托实例:Func<Task<TResult>>、Func<Task>、Action 我们还展示了如何将Main函数改造为异步函数。 希望上面的例子对大家有所帮助~ 阅读全文
posted @ 2020-01-09 11:11 PowerCoder 阅读(2053) 评论(0) 推荐(0)
SQL Server在简单恢复模式下,为什么有时候日志文件还是会增长得很快且很大?(转载)

摘要:关于这个问题,首先建议先看看下面这个帖子的内容: Why Does the Transaction Log Keep Growing or Run Out of Space? 里面有很多专家进行了详细的阐述,特别是这个回答 这里我把里面比较关键的几个信息贴在下面: 首先我们要了解在SQL Serve 阅读全文
posted @ 2020-01-08 19:02 PowerCoder 阅读(1056) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3