Esempio n. 1
0
        public static SaveException Parse(EntityManager em, String json)
        {
            var jn           = JNode.DeserializeFrom(json);
            var message      = jn.Get <String>("ExceptionMessage");
            var entityErrors = jn.GetArray <EntityError>("EntityErrors");
            var saveErrors   = entityErrors.Select(ee => ee.Resolve(em));

            return(new SaveException(message ?? "see EntityErrors property", saveErrors));
        }
Esempio n. 2
0
        public static SaveException Parse(String json)
        {
            var jn      = JNode.DeserializeFrom(json);
            var message = jn.Get <String>("ExceptionMessage");

            if (message != null)
            {
                return(new SaveException(message, Enumerable.Empty <EntityError>()));
            }
            else
            {
                // TODO: parse EntityErrors;
                return(new SaveException("see EntityErrors property", Enumerable.Empty <EntityError>()));
            }
        }
Esempio n. 3
0
        public void ImportMetadata(TextReader textReader)
        {
            var jNode = JNode.DeserializeFrom(textReader);

            ImportMetadata(jNode);
        }
Esempio n. 4
0
        public void ImportMetadata(String metadata)
        {
            var jNode = JNode.DeserializeFrom(metadata);

            ImportMetadata(jNode);
        }
Esempio n. 5
0
        public ImportResult ImportEntities(TextReader textReader, ImportOptions importOptions = null)
        {
            var jn = JNode.DeserializeFrom(textReader);

            return(ImportEntities(jn, importOptions));
        }
Esempio n. 6
0
        public ImportResult ImportEntities(String exportedString, ImportOptions importOptions = null)
        {
            var jn = JNode.DeserializeFrom(exportedString);

            return(ImportEntities(jn, importOptions));
        }