Esempio n. 1
0
        /// <summary>
        /// Determines whether the entity can participate in a many-to-many relationship.
        /// </summary>
        /// <param name="entity">Entity</param>
        /// <returns></returns>
        public static bool EligibleCreateManyToManyRelationship(CrmServiceClient service, string entity)
        {
            var canManyToManyRequest = new CanManyToManyRequest
            {
                EntityName = entity
            };

            var canManyToManyResponse = (CanManyToManyResponse)service.Execute(canManyToManyRequest);

            if (!canManyToManyResponse.CanManyToMany)
            {
                Console.WriteLine(
                    "Entity {0} can't participate in a many-to-many relationship.",
                    entity);
            }

            return(canManyToManyResponse.CanManyToMany);
        }
Esempio n. 2
0
        //<snippetWorkWithRelationships3>
        /// <summary>
        /// Determines whether the entity can participate in a many-to-many relationship.
        /// </summary>
        /// <param name="entity">Entity</param>
        /// <returns></returns>
        public bool EligibleCreateManyToManyRelationship(string entity)
        {
            CanManyToManyRequest canManyToManyRequest = new CanManyToManyRequest
            {
                EntityName = entity
            };

            CanManyToManyResponse canManyToManyResponse =
                (CanManyToManyResponse)_serviceProxy.Execute(canManyToManyRequest);

            if (!canManyToManyResponse.CanManyToMany)
            {
                Console.WriteLine(
                    "Entity {0} can't participate in a many-to-many relationship.",
                    entity);
            }

            return(canManyToManyResponse.CanManyToMany);
        }
Esempio n. 3
0
        //<snippetWorkWithRelationships3>
        /// <summary>
        /// Determines whether the entity can participate in a many-to-many relationship.
        /// </summary>
        /// <param name="entity">Entity</param>
        /// <returns></returns>
        public bool EligibleCreateManyToManyRelationship(string entity)
        {
            CanManyToManyRequest canManyToManyRequest = new CanManyToManyRequest
            {
                EntityName = entity
            };

            CanManyToManyResponse canManyToManyResponse =
                (CanManyToManyResponse)_serviceProxy.Execute(canManyToManyRequest);

            if (!canManyToManyResponse.CanManyToMany)
            {
                Console.WriteLine(
                    "Entity {0} can't participate in a many-to-many relationship.", 
                    entity);
            }

            return canManyToManyResponse.CanManyToMany;
        }