Example #1
0
 public static string SerialiseEntityQueryExpression(EntityQueryExpression item)
 {
     if (item != null)
     {
         string xml =
             @"<b:value i:type='c:EntityQueryExpression' xmlns:c='http://schemas.microsoft.com/xrm/2011/Metadata/Query'>"
             + MetadataSerialiser.SerialiseMetadataQueryExpression(item);
         if (item.AttributeQuery != null)
         {
             xml += @"<c:AttributeQuery>"
                    + MetadataSerialiser.SerialiseAttributeQueryExpression(item.AttributeQuery)
                    + @"</c:AttributeQuery>";
         }
         xml += @"<c:LabelQuery>"
                + MetadataSerialiser.SerialiseLabelQueryExpression(item.LabelQuery)
                + @"</c:LabelQuery>
         <c:RelationshipQuery i:nil='true' />
         </b:value>";
         return(xml);
     }
     else
     {
         return("<b:value i:nil='true'/>");
     }
 }
 public static string SerialiseMetadataQueryExpression(MetadataQueryExpression item)
 {
     if (item != null)
     {
         string xml =
             @"<c:Criteria>"
             + MetadataSerialiser.SerialiseMetadataFilterExpression(item.Criteria) +
             @"</c:Criteria>
             <c:Properties>"
             + MetadataSerialiser.SerialiseMetadataPropertiesExpression(item.Properties)
             + @" </c:Properties>";
         return(xml);
     }
     return("");
 }
Example #3
0
        public static string SerialiseMetadataFilterExpression(MetadataFilterExpression item)
        {
            if (item != null)
            {
                string xml = @"<c:Conditions>";


                foreach (MetadataConditionExpression ex in item.Conditions)
                {
                    xml += MetadataSerialiser.SerialiseMetadataConditionExpression(ex);
                }

                xml = xml + @"</c:Conditions>
                        <c:FilterOperator>" + item.FilterOperator.ToString() + @"</c:FilterOperator>
                        <c:Filters />";
                return(xml);
            }
            return("");
        }
 public static string SerialiseAttributeQueryExpression(AttributeQueryExpression item)
 {
     return(MetadataSerialiser.SerialiseMetadataQueryExpression(item));
 }