Thursday, July 22, 2010

Serializing Generic Types

There is no way currently of constraining a Generic type to ensure it is serializable at compile-time. However, there is a quick and easy way to check.


if (!typeof(T).IsSerializable)
{
throw new ArgumentException("type is not serializable");
}

1 comment:

  1. Merkur Gold Strike Safety Razor - FEBCASINO
    Merkur's Gold goyangfc.com Strike Safety ventureberg.com/ Razor, Merkur Platinum Edge Plated Finish, https://septcasino.com/review/merit-casino/ German, Gold-Plated, Satin Chrome 바카라 Finish. Merkur has https://febcasino.com/review/merit-casino/ a more aggressive looking,

    ReplyDelete