Programming (back-end)

.NET types can have spaces. And not only spaces.

No, you cannot write code like that:

clr-art2

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 System.Reflection.Emit containing 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:
clr-art

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).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s