Ejemplo n.º 1
0
        public static void GetIdentity_of_StorageAssociationTypeMapping_returns_expected_value()
        {
            var associationType        = new AssociationType("AT", "N", false, DataSpace.CSpace);
            StorageTypeMapping mapping = new StorageAssociationTypeMapping(associationType, null);

            Assert.Equal(associationType.Identity, BaseMetadataMappingVisitor.IdentityHelper.GetIdentity(mapping));
        }
        internal StorageAssociationSetMapping(AssociationSet extent, EntitySet entitySet)
            : base(extent, null)
        {
            DebugCheck.NotNull(entitySet);

            var associationTypeMapping
                = new StorageAssociationTypeMapping(extent.ElementType, this);

            var mappingFragment
                = new StorageMappingFragment(entitySet, associationTypeMapping, false);

            associationTypeMapping.AddFragment(mappingFragment);

            AddTypeMapping(associationTypeMapping);
        }
Ejemplo n.º 3
0
        internal StorageAssociationSetMapping(AssociationSet extent, EntitySet entitySet)
            : base(extent, null)
        {
            DebugCheck.NotNull(entitySet);

            var associationTypeMapping
                = new StorageAssociationTypeMapping(extent.ElementType, this);

            var mappingFragment
                = new StorageMappingFragment(entitySet, associationTypeMapping, false);

            associationTypeMapping.AddFragment(mappingFragment);

            AddTypeMapping(associationTypeMapping);
        }
        /// <summary>
        ///     Finds members participating in the assocciation and adds them to the <paramref name="interestingMembers" />.
        /// </summary>
        /// <param name="associationTypeMapping"> Association type mapping. Must not be null. </param>
        /// <param name="interestingMembers"> The list the interesting members (if any) will be added to. Must not be null. </param>
        private static void FindInterestingAssociationMappingMembers(
            StorageAssociationTypeMapping associationTypeMapping, List<EdmMember> interestingMembers)
        {
            Debug.Assert(associationTypeMapping != null, "entityTypeMapping != null");
            Debug.Assert(interestingMembers != null, "interestingMembers != null");

            //(2) Ends participating in association are "interesting"
            interestingMembers.AddRange(
                associationTypeMapping
                    .MappingFragments
                    .SelectMany(m => m.AllProperties)
                    .OfType<StorageEndPropertyMapping>()
                    .Select(epm => epm.EndMember));
        }
 public static string GetIdentity(StorageAssociationTypeMapping mapping)
 {
     return(mapping.AssociationType.Identity);
 }
        public static void GetIdentity_of_StorageAssociationTypeMapping_returns_expected_value()
        {
            var associationType = new AssociationType("AT", "N", false, DataSpace.CSpace);
            StorageTypeMapping mapping = new StorageAssociationTypeMapping(associationType, null);

            Assert.Equal(associationType.Identity, BaseMetadataMappingVisitor.IdentityHelper.GetIdentity(mapping));
        }