public EnumRepresentationConvention(BsonType representation) { if (!((representation == 0) || (representation == BsonType.String) || (representation == BsonType.Int32) || (representation == BsonType.Int64))) { throw new ArgumentException("Enums can only be represented as String, Int32, Int64 or the type of the enum"); } _representation = representation; }