.net核心是否支持代码合同? [英] Are code contracts supported in .net core?
本文介绍了.net核心是否支持代码合同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
.net框架中有代码契约,可让我在代码中指定前置/后置条件..net core/.net 5是否支持它们?
In the .net framework there were Code Contracts which allowed me to specify pre/post conditons in my code. Are they supported in .net core/.net 5?
推荐答案
命名空间 System.Diagnostics.Contracts
可用,但项目不兑现.
Namespace System.Diagnostics.Contracts
is available but project is abadoned.
关于.Net Core的讨论
Discussion about .Net Core
https://github.com/dotnet/runtime/issues/23869
代码合同是否仍是2020年的推荐方式
Is Code Contracts still the recommended way to go in 2020
https://github.com/dotnet/docs/issues/17640
这篇关于.net核心是否支持代码合同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文