AqlaSolutions/AqlaSerializer

Un-defined enum values

inethui opened this issue · 1 comments

Protobuf-net allows un-defined enum values, but Aqla doesn't. The following code shows that:

        private enum Number { One, Two, Three }

        [Fact]
        public void TestNotDefinedEnum()
        {
            Number four = (Number)4;
         
            var clone = ProtoBuf.Serializer.DeepClone(four);
            Assert.Equal(clone, four);

            var clone2 = AqlaSerializer.Serializer.DeepClone(four);
            Assert.Equal(clone2, four);
        }

Is there a way to support undefined enum values with Aqla?

This behavior can be toggled with EnumPassthru on a type attribute or MetaType property. I have changed its defaults to true in develop branch.