Пример #1
0
        /// <summary>
        ///     This method will add an CreateForeignKeyProperties 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 not 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 CreateForeignKeyProperties(cpc, association);

            cpc.AddIntegrityCheck(check);
        }
        /// <summary>
        ///     This method will add an CreateForeignKeyProperties 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 not 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 CreateForeignKeyProperties(cpc, association);
            cpc.AddIntegrityCheck(check);
        }