For testing snippets of C# code in SO questions, https://www.linqpad.net is the best thing since sliced bread. Do try it.
CV: https://uk.linkedin.com/in/chrisfcarroll
Blog: https://cafe-encounter.net