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); }
public string Serialize(OclDocument document) { var sb = new StringBuilder(); // ReSharper disable once ConvertToUsingDeclaration using (var writer = new OclWriter(sb, options)) { writer.Write(document); } return(sb.ToString()); }
public T Deserialize <T>(OclDocument document) where T : notnull => (T)Deserialize(document, typeof(T));