In Visual Studio when we paste code into our files often it won’t compile as we need to add using directives first.
Thankfully Visual Studio has a useful setting which causes it to add any missing using directives when we paste.
To enable check the box highlighted below…