The Forum for Discussion about The Third Manifesto and Related Matters

Please or Register to create posts and topics.

C# 9.0 has data classes

Not to be out done by Java records, it looks like the upcoming C# 9.0 is going to have new data classes.

Why? Mainly because struct is too limited for use as a database record. It has no inheritance, copy semantics and requires a null ctor. Great for values, not so great for records.

The data class gives you all the machinery you need for records that behave as immutable values but implemented as a reference type and with the full range of related features. I guess they looked at Java records and decided to do it better.

It also has a number of interesting other features not so relevant here.


Andl - A New Database Language -