Esempio n. 1
0
        public static bool EarseSchema(this Document document, SAMSchema sAMSchema, bool useTransaction = true)
        {
            if (sAMSchema == null || document == null)
            {
                return(false);
            }

            return(EarseSchema(document, sAMSchema.Guid, useTransaction));
        }
Esempio n. 2
0
        public static bool HasSchema(this Element element, SAMSchema sAMSchema)
        {
            if (element == null || sAMSchema == null || sAMSchema.Guid == Guid.Empty)
            {
                return(false);
            }

            IList <Guid> guids = element.GetEntitySchemaGuids();

            if (guids == null || guids.Count == 0)
            {
                return(false);
            }

            return(guids.Contains(sAMSchema.Guid));
        }
Esempio n. 3
0
        public static bool SetJArray(this SAMSchema sAMSchema, Element element, JArray jArray)
        {
            if (sAMSchema == null || element == null || jArray == null)
            {
                return(false);
            }

            string fieldName = sAMSchema.FieldName;

            if (string.IsNullOrWhiteSpace(fieldName))
            {
                return(false);
            }

            return(SetJArray(sAMSchema.GetSchema(), element, jArray, fieldName));
        }
Esempio n. 4
0
        public static bool SetJObject(this SAMSchema sAMSchema, Element element, JObject jObject)
        {
            if (sAMSchema == null || element == null || jObject == null)
            {
                return(false);
            }

            string fieldName = sAMSchema.FieldName;

            if (string.IsNullOrWhiteSpace(fieldName))
            {
                return(false);
            }

            return(SetJObject(sAMSchema.GetSchema(), element, jObject, fieldName));
        }