摘要:
下面的文章,很好地阐述了.NET Core各个版本之间的兼容问题: Is .NET Core Runtime backwards compatible with previous releases? 阅读全文
摘要:
问 Do TransactionScope work with closed database connections? using (var transaction = new TransactionScope(TransactionScopeOption.Required)) { // crea 阅读全文
摘要:
TransactionScope and Async/Await. Be one with the flow! You might not know this, but the 4.5.0 version of the .NET Framework contains a serious bug re 阅读全文
摘要:
问 I am sending a stream to methods to write on, and in those methods I am using a binary reader/wrtier. When the reader/writer gets disposed, either b 阅读全文
摘要:
在C#中,StreamReader的ReadLine方法是不支持自定义行分隔符的。这导致很多文本文件的行分隔符如果不是"\r"和"\n",那么使用StreamReader就无法正确读取到一行字符串。 所以我们这里采用一个.NET Core控制台项目,自定义一个ReadLineWithDelimite 阅读全文
摘要:
微软官网的这篇文章阐述了,在ASP.NET Core中的静态文件处理: Static files in ASP.NET Core 注意其中有几点很有用: 使用FileExtensionContentTypeProvider,来自定义静态文件扩展名的映射 启用非标准静态文件类型,可以让ASP.NET 阅读全文
摘要:
有时候我们会将一个小数字符串转换为整数,例如将"31.0"转换为整数类型,因为这个小数本来就是一个整数,它的小数位为0。 SQL Server 如果我们在SQL Server中直接将字符串'31.0'转换为INT类型,会报错: DECLARE @text NVARCHAR(50)=N'31.0' S 阅读全文
摘要:
问 Looking at the implementation of CancellationToken.None, it is simply returning default(CancellationToken). However, I see no reference in Cancellat 阅读全文
摘要:
问 I've seen in BOL under the section regarding Stored Procedures, specifically declaring OUTPUT parameters, where both "OUTPUT" and "OUT" are used.Is 阅读全文
摘要:
相信有些同学会困扰,当我们执行TransactionScope.Complete()方法的时候,是否Transaction被真正提交到数据库了。 对于这一点,MSDN上有这么一段描述: If the TransactionScope object created the transaction in 阅读全文