Yes, you shouldn't be hard-coding a fixed set of protocols. But here what your code does is enabling Tls12
without affecting others which is fine. It automatically takes advantage of new protocols added in the future.
Or you can target .NET Framework 4.7 or later versions on your apps. Target .NET Framework 4.7.1 or later versions on your WCF apps: Transport Layer Security (TLS) best practices with the .NET Framework