Beispiel #1
0
        public object Deserialize(OclDocument document, Type type)
        {
            var context = new OclConversionContext(options);
            var result  = context.FromElement(type, document, null);

            if (result == null)
            {
                throw new OclException("Document conversion resulted in null, which is not valid");
            }
            return(result);
        }
Beispiel #2
0
        public OclDocument ToOclDocument(object?obj)
        {
            if (obj == null)
            {
                return(new OclDocument());
            }

            var context = new OclConversionContext(options);

            var converter = context.GetConverterFor(obj.GetType());

            return(converter.ToDocument(context, obj));
        }