No, you cannot write code like that:
At the same time there is no new C# 9.0 nor C# One that allow to write such code. But there is a namespace called
TypeBuilder that can generate valid CLR types. Here’s a sample code that you can use, to put some more life into your Employee entity:
I don’t suggest to start writing code like that, but have it in mind while playing with reflection on some external libraries (I guess there would be a problem when serializing such object to XML).