You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
1.1 KiB
Markdown

# C#8 接口新功能学习
**.NET Core 3.0及以上版本** 和 **.NET Standard 2.1** 支持 C#8.0,详情参阅 [C#语言版本控制](https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/configure-language-version)
C# 8的许多最新功能需要 .NET Core 3.x 中引入的库和运行时功能
+ 默认接口实现需要使用 .NET Core 3.0 CLR 中的新功能
+ 异步流需要使用新类型 System.IAsyncDisposable、System.Collections.Generic.IAsyncEnumerable<T> 和 System.Collections.Generic.IAsyncEnumerator<T>
+ 索引和范围需要使用新类型 System.Index 和 System.Range
+ 可为 null 的引用类型利用几个特性来提供更准确的警告。 这些特性是在 .NET Core 3.0 中添加的。 其他目标框架并未使用这些特性中的任何一种进行批注。 这意味着可为 null 的警告可能无法准确反映潜在问题。
## 接口新功能条件
+ C# 8.0及以上
+ **.NET Core3.0及以上** 或者 **.NET Standard 2.1** (.net framework不支持)
+ Visual Studio 2019 16.1 及以上
## 默认实现
## 静态方法支持
##