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)); }
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)); }
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)); }
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)); }