예제 #1
0
        public void ToStringTest()
        {
            var    fetchXml       = new FetchXmlExpression(Xml);
            string fetchXmlString = fetchXml.ToString();

            Assert.True(!fetchXmlString.Contains(Environment.NewLine));
        }
예제 #2
0
        public async Task <RetrieveMultipleResponse> RetrieveMultipleAsync(FetchXmlExpression fetchXml)
        {
            string entityCollection = WebApiMetadata.GetEntitySetName(fetchXml.LogicalName);
            var    retrieveOptions  = new RetrieveOptions {
                FetchXml = fetchXml
            };

            return(await RetrieveMultipleAsync(entityCollection, retrieveOptions));
        }
예제 #3
0
        public void ImplicitConversionTest()
        {
            var                fetchXml           = new FetchXmlExpression(Xml);
            string             fetchXmlString     = fetchXml;
            FetchXmlExpression fetchXmlExpression = fetchXmlString;

            Assert.True(fetchXmlExpression.LogicalName == "contact");
            Assert.True(fetchXmlString.Contains("name=\"contact\""));
        }
예제 #4
0
        public virtual Task <EntityCollection> RetrieveMultipleAsync(FetchXmlExpression fetchXml,
                                                                     CancellationToken cancellationToken = default)
        {
            if (fetchXml is null)
            {
                throw new ArgumentNullException(nameof(fetchXml));
            }

            var entityMetadata = WebApiMetadata.GetEntityMetadata(fetchXml.EntityName);

            var query = $"{entityMetadata.EntitySetName}?fetchXml={System.Net.WebUtility.UrlEncode(fetchXml)}";

            return(ExecuteFunctionAsync <EntityCollection>(query, cancellationToken));
        }
예제 #5
0
 public RetrieveMultipleResponse RetrieveMultiple(FetchXmlExpression fetchXml)
 {
     return(RetrieveMultipleAsync(fetchXml).GetAwaiter().GetResult());
 }
예제 #6
0
        public void ParseFetchXmlTest()
        {
            var fetchXml = new FetchXmlExpression(Xml);

            Assert.True(fetchXml.LogicalName == "contact");
        }