What are custom value types in C#? How can I create them?
To create a value type, you need to define your type as a struct
(as opposed to a class
, which defines a reference type). For instance:
struct MyValueType
{
public string MyField;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With