Exemple #1
0
        public static bool Compare(ODataPath odataPath1, ODataPath odataPath2)
        {
            if (odataPath1.Count != odataPath2.Count)
            {
                return(false);
            }

            ODataPathComparer comparer = null;

            try
            {
                comparer = new ODataPathComparer(odataPath1);
                foreach (bool result in odataPath2.WalkWith(comparer))
                {
                    if (!result)
                    {
                        return(false);
                    }
                }
            }
            finally
            {
                if (comparer != null && comparer._segments != null)
                {
                    comparer._segments.Dispose();
                }
            }
            return(true);
        }
Exemple #2
0
        public bool Compare(OeCacheContext cacheContext1, OeCacheContext cacheContext2)
        {
            if (cacheContext1.NavigationNextLink != cacheContext2.NavigationNextLink)
            {
                return(false);
            }

            if (cacheContext1.MetadataLevel != cacheContext2.MetadataLevel)
            {
                return(false);
            }

            ODataUri uri1 = cacheContext1.ODataUri;
            ODataUri uri2 = cacheContext2.ODataUri;

            if (!ODataPathComparer.Compare(uri1.Path, uri2.Path))
            {
                return(false);
            }

            if (!CompareParseNavigationSegments(cacheContext1.ParseNavigationSegments, cacheContext2.ParseNavigationSegments))
            {
                return(false);
            }

            if (!CompareApply(uri1.Apply, uri2.Apply))
            {
                return(false);
            }

            if (!CompareFilter(uri1.Filter, uri2.Filter, false))
            {
                return(false);
            }

            if (!CompareSelectAndExpand(uri1.SelectAndExpand, uri2.SelectAndExpand, uri1.Path))
            {
                return(false);
            }

            if (!CompareOrderBy(uri1.OrderBy, uri2.OrderBy, false))
            {
                return(false);
            }

            if (!CompareSkip(uri1.Skip, uri2.Skip, uri1.Path))
            {
                return(false);
            }

            if (!CompareTop(uri1.Top, uri2.Top, uri1.Path))
            {
                return(false);
            }

            if (!CompareSkipToken(cacheContext1.SkipTokenNameValues, cacheContext2.SkipTokenNameValues))
            {
                return(false);
            }

            if (!CompareCompute(uri1.Compute, uri2.Compute))
            {
                return(false);
            }

            return(true);
        }