/// <summary>
        /// Filters the entities/relationships and columns based on the MicrosoftCrmPortalBase solution version in CRM.
        /// </summary>
        /// <param name="solution"></param>
        /// <param name="crmSolutions"></param>
        /// <returns></returns>
        private static SolutionDefinition GetFilteredSolution(SolutionDefinition solution, IDictionary <string, SolutionInfo> crmSolutions)
        {
            if (solution.Solutions == null || !solution.Solutions.Any())
            {
                return(null);
            }

            var filteredEntities = solution.GetFilteredEntities(crmSolutions);

            return(new SolutionDefinition(solution.Solutions, filteredEntities, solution.ManyRelationships));
        }
コード例 #2
0
        protected virtual IEnumerable <Entity> GetEntities(CrmDbContext context, SolutionDefinition solution, IDictionary <string, object> parameters)
        {
            ConcurrentBag <Entity> result = new ConcurrentBag <Entity>();
            var queries = solution.GetQueries(parameters).Where(query => query != null);

            Parallel.ForEach(queries, query =>
            {
                // Add content map entities explicitly to the Portalused entities list.
                // Since we are skipping cache for content map entities and hence these entities won't be added in this list via Dependency calucaltion.
                ADXTrace.Instance.TraceVerbose(TraceCategory.Application, $"Entity {query.Entity.Name} is added to Enabled Entity List for Portal Cache ");
                WebAppConfigurationProvider.PortalUsedEntities.TryAdd(query.Entity.Name, true);
                Fetch(context.Service, query, result);
            });

            return(result.AsEnumerable());
        }
コード例 #3
0
        private static SolutionDefinition Union(SolutionDefinition first, SolutionDefinition second)
        {
            if (first == null && second == null)
            {
                return(null);
            }
            if (first == null)
            {
                return(second);
            }
            if (second == null)
            {
                return(first);
            }

            var solutions     = first.Solutions.Union(second.Solutions).ToArray();
            var entities      = Union(first.Entities, second.Entities, first.Solutions).ToDictionary(e => e.LogicalName, e => e);
            var relationships = Union(first.ManyRelationships, second.ManyRelationships, first.Solutions).ToDictionary(r => r.SchemaName, r => r);

            return(new SolutionDefinition(solutions, entities, relationships));
        }
コード例 #4
0
 public ContentMap(SolutionDefinition solution)
 {
     Solution    = solution;
     LockTimeout = TimeSpan.FromMinutes(1);
 }
コード例 #5
0
 public SolutionDefinition Union(SolutionDefinition solution)
 {
     return(Union(this, solution));
 }