问题
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?
回答1:
Namespace System.Diagnostics.Contracts
is available but project is abadoned.
Alternative VS2019
https://softwarerecs.stackexchange.com/questions/47108/the-best-code-contracts-alternative-for-vs-2017-2019-and-net-core-projects
Discussion about .Net Core
https://github.com/dotnet/runtime/issues/23869
Is Code Contracts still the recommended way to go in 2020
https://github.com/dotnet/docs/issues/17640
来源:https://stackoverflow.com/questions/64985444/are-code-contracts-supported-in-net-core