Beispiel #1
0
 public MappingManyToManyView(
     ManyToManyNavigation manyToManyNavigation,
     ManyToManyStoreTable manyToManyStoreTable,
     ManyToManyKeys manyToManyKeys)
 {
     this.manyToManyNavigation = manyToManyNavigation;
     this.manyToManyStoreTable = manyToManyStoreTable;
     this.manyToManyKeys       = manyToManyKeys;
 }
        public void ManyToManyKeysShouldMapKeys()
        {
            var entityTypeBuilder = new EntityTypeBuilder();
            var posts             = entityTypeBuilder
                                    .Name("My.Post")
                                    .WithProperty <int>("ID")
                                    .WithProperty <int>("_ignore0")
                                    .WithProperty <int>("_ignore1")
                                    .WithKeys("ID")
                                    .Build();

            var keyMappings = new Dictionary <EdmMember, string>()
            {
                { posts.Properties.First(), "Post_ID" },
            };

            var testSubject = new ManyToManyKeys(
                posts, keyMappings,
                posts, keyMappings);

            testSubject.MapRightKeys.Should().ContainInOrder("Post_ID");
            testSubject.MapLeftKeys.Should().ContainInOrder("Post_ID");
        }