Adxstudio.Xrm.Services.OrganizationServiceCache.InvalidateCacheDependencies(System.Collections.Generic.IEnumerable)

Here are the examples of the csharp api class Adxstudio.Xrm.Services.OrganizationServiceCache.InvalidateCacheDependencies(System.Collections.Generic.IEnumerable) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

1. Example

Project: xRM-Portals-Community-Edition
Source File: OrganizationServiceCache.cs
public void Remove(Entity entity)
		{
			InvalidateCacheDependencies(this.CacheDependencyCalculator.GetDependencies(entity, false));
		}

2. Example

Project: xRM-Portals-Community-Edition
Source File: OrganizationServiceCache.cs
public void Remove(EntityReference entity)
		{
			InvalidateCacheDependencies(this.CacheDependencyCalculator.GetDependencies(entity, false));
		}

3. Example

Project: xRM-Portals-Community-Edition
Source File: OrganizationServiceCache.cs
public void Remove(OrganizationRequest request)
		{
			var dependencies = this.CacheDependencyCalculator.GetDependenciesForObject(request).ToList();

			InvalidateCacheDependencies(dependencies);
		}

4. Example

Project: xRM-Portals-Community-Edition
Source File: OrganizationServiceCache.cs
private TResult InnerExecute<TRequest, TResponse, TResult>(TRequest request, Func<TRequest, TResponse> execute, Func<TResponse, TResult> selector, string selectorCacheKey)
		{
			// perform a cached execute or fallback to a regular execute

			var isCachedRequest = CacheDependencyCalculator.IsCachedRequest(request as OrganizationRequest);

			// For content map, we don't want to cache the queries so checking if SkipCache is set to true.
			var cachedOrganizationRequest = request as CachedOrganizationRequest;

			var isStaleDataAllowed = cachedOrganizationRequest?.IsFlagEnabled(RequestFlag.AllowStaleData) == true;
			var fetch = cachedOrganizationRequest?.ToFetch();
			var skipCache = fetch?.SkipCache == true;

			var response = isCachedRequest && !skipCache ? Get(request, execute, selector, selectorCacheKey, isStaleDataAllowed) : InnerExecute(request, execute, selector);

			// Check if we want to skip the cache invalidation. We want to skip this intentionally for some requests like forum count update.
			var bypassCacheInvalidation = cachedOrganizationRequest?.IsFlagEnabled(RequestFlag.ByPassCacheInvalidation) == true;

			if (!isCachedRequest && !bypassCacheInvalidation)
			{
				var dependencies = this.CacheDependencyCalculator.GetDependenciesForObject(request).ToList();
				InvalidateCacheDependencies(dependencies);
			}

			return response;
		}