且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

throw new NotImplementedException();

更新时间:2023-02-14 19:27:01

Visual Studio添加行:

Visual studio adds the line:
throw new NotImplementedException();

当它自动为您创建一个方法时,允许您有一个标记,表明您需要做一些工作。如果你忘记了,那么当你运行你的代码时会抛出异常,这会警告你的代码可能不起作用 - 因为你没有写过它!



删除该行,并填写代码以执行该方法的功能!

When it automatically creates a method for you, allowing you to have a marker that there is some work you have to do. If you forget, then the exception is thrown when you run your code, and this serves as a warning that your code probably won't work - because you haven't written it!

Remove the line, and fill in the code to perform the function the method is there for!