摘要:
下面的链接为微软官方文档,介绍ASP.NET Core中的模型验证机制: Model validation in ASP.NET Core MVC and Razor Pages 阅读全文
摘要:
新建一个.NET Core控制台项目,然后引入Json.NET的NuGet包:Newtonsoft.Json,我们使用Json.NET将类序列化为JSON字符串,再将JSON字符串反序列化为类,代码如下: using Newtonsoft.Json; using System; namespace 阅读全文
摘要:
新建一个.NET Core控制台项目,使用文件流读写网络共享盘文件,如下所示: using System; using System.IO; using System.Text; namespace NetCoreShareFolderReading { class Program { static 阅读全文
摘要:
问: I tried to find out but I don't sure that is Redis MVCC? Does Redis allow reading during writing? 答: Redis is single-threaded. All commands are ato 阅读全文
摘要:
问: ASP.NET core server, AllowSynchronousIO is set to false new WebHostBuilder() .UseKestrel(options => { options.AllowSynchronousIO = false; }) In the 阅读全文
摘要:
官方NuGet链接如下: Microsoft.Data.SqlClient 微软官方文档介绍: Introduction to Microsoft.Data.SqlClient namespace 另一篇很详细的介绍文章: Introducing the new Microsoft.Data.Sql 阅读全文
摘要:
下面这段SQL脚本,可以根据单个数据库中所有文件(数据文件、日志文件等)的大小,来收缩数据库文件: DECLARE @databaseFiles TABLE ( freeSpace FLOAT, fileName NVARCHAR(300) ) INSERT INTO @databaseFiles( 阅读全文
摘要:
下面这篇微软官方文档,介绍了如何在ASP.NET Core中使用CORS,来实现客户端浏览器AJAX的跨域请求: Enable Cross-Origin Requests (CORS) in ASP.NET Core 阅读全文
摘要:
下面这篇微软官方文档,介绍了C#中的public、private、protected、internal等访问修饰符: Access Modifiers (C# Programming Guide) 文档中有两个地方,这里特别强调下: Classes and structs declared dire 阅读全文
摘要:
问 Why is it possible to write constructor for an abstract class in C#?As far as I know we can't instantiate an abstract class.. so what is it for?You 阅读全文