internal static void AddRule(CommandProcessorContext cpc, ConceptualEntityType element)
 {
     if (element != null)
     {
         IIntegrityCheck check = new PropagateViewKeysToStorageModel(cpc, element);
         cpc.AddIntegrityCheck(check);
     }
 }
        /// <summary>
        ///     Schedule the given set of bindings for rebinding when the transaction completes
        /// </summary>
        /// <param name="cpc"></param>
        /// <param name="bindingsToRebind"></param>
        internal static void ScheduleBindingsForRebind(CommandProcessorContext cpc, ICollection<ItemBinding> bindingsToRebind)
        {
            Debug.Assert(cpc != null);
            Debug.Assert(bindingsToRebind != null);

            if (bindingsToRebind.Count > 0)
            {
                var check = new CheckArtifactBindings(cpc);
                cpc.AddIntegrityCheck(check);

                foreach (var ib in bindingsToRebind)
                {
                    cpc.AddBindingForRebind(ib);
                }
            }
        }
 internal static void AddRule(CommandProcessorContext cpc, EntitySetMapping element)
 {
     if (element != null)
     {
         IIntegrityCheck check = new EnforceEntitySetMappingRules(cpc, element);
         cpc.AddIntegrityCheck(check);
     }
 }
        /// <summary>
        ///     This method will add an InferReferentialContraints IntegrityCheck for the passed in
        ///     association.
        /// </summary>
        /// <param name="cpc"></param>
        /// <param name="association">This is only valid for C-Side associations.</param>
        internal static void AddRule(CommandProcessorContext cpc, Association association)
        {
            Debug.Assert(association != null, "association should not be null");
            Debug.Assert(association.EntityModel.IsCSDL, "association should be from C-side");
            Debug.Assert(
                association.AssociationEnds().Count == 2,
                "association.AssociationEnds().Count(" + association.AssociationEnds().Count + ") should be 2");
            Debug.Assert(association.AssociationSet != null, "association.AssociationSet should not be null");

            IIntegrityCheck check = new InferReferentialConstraints(cpc, association);
            cpc.AddIntegrityCheck(check);
        }
 // add one PropagateConceptualSGPToStorageProperty for each StorageProperty mapped to this ConceptualProperty
 internal static void AddRule(CommandProcessorContext cpc, ConceptualProperty cProp, bool propagateNoneSGP)
 {
     if (null != cProp)
     {
         foreach (var sProp in MappedStorageProperties(cProp))
         {
             IIntegrityCheck check = new PropagateStoreGeneratedPatternToStorageModel(cpc, sProp, propagateNoneSGP);
             cpc.AddIntegrityCheck(check);
         }
     }
 }
 internal static void AddRule(CommandProcessorContext cpc, EFArtifact artifact, bool propagateNoneSGP)
 {
     if (null != artifact)
     {
         IIntegrityCheck check = new PropagateStoreGeneratedPatternToStorageModel(cpc, artifact, propagateNoneSGP);
         cpc.AddIntegrityCheck(check);
     }
 }
        internal static void AddRule(CommandProcessorContext cpc, AssociationSetMapping associationSetMapping)
        {
            Debug.Assert(associationSetMapping != null, "associationSetMapping should not be null");

            IIntegrityCheck check = new EnforceAssociationSetMappingRules(cpc, associationSetMapping);
            cpc.AddIntegrityCheck(check);
        }