0

I have big C# class which is generated from XSD schema. There is any possible ways to use "?.' safe operator in .NET Framework 4.5.1 with out upgrading the .NET framework version. Instead of writing null check for each object.

Sprotty
  • 5,676
  • 3
  • 33
  • 52
Dinesh
  • 41
  • 1
  • 2
  • 9

1 Answers1

1

The null conditional operator (?.) is syntactical glitter added in C# version 6. The Roslyn compiler in Visual Studio 2015 and above will compile C# 6 and target the output at the appropriate .Net runtime.

For more information look at Does C# 6.0 work for .NET 4.0?

So in summary, you can use these language features on .net 2.0 and above as long as you build them in Visual Studio 2015 or above.

Community
  • 1
  • 1
Sprotty
  • 5,676
  • 3
  • 33
  • 52