コード例 #1
0
        public void ShouldReturnPrimaryKeyMemberandColumnName()
        {
            using (SampleContext emptyContext1 = new XmlFileContext <SampleContext>(this.GetType()).Empty())
            {
                var pkName = emptyContext1.KeyMemberFor(typeof(Author));
                pkName.ShouldBe("Id");

                pkName = emptyContext1.KeyMemberFor(typeof(Post));
                pkName.ShouldBe("Id");

                var pkColumnFor = emptyContext1.PrimaryKeyColumnFor(typeof(Author));
                pkColumnFor.ShouldBe("AUT_ID");

                pkColumnFor = emptyContext1.PrimaryKeyColumnFor(typeof(Post));
                pkColumnFor.ShouldBe("Post_Id");
            }
        }
コード例 #2
0
        public void ShouldReturnPrimaryKeyMemberandColumnName()
        {
            using (SampleContext emptyContext1 = new XmlFileContext<SampleContext>(this.GetType()).Empty())
            {
                var pkName = emptyContext1.KeyMemberFor(typeof(Author));
                pkName.ShouldBe("Id");
                
                pkName = emptyContext1.KeyMemberFor(typeof(Post));
                pkName.ShouldBe("Id");

                var pkColumnFor = emptyContext1.PrimaryKeyColumnFor(typeof(Author));
                pkColumnFor.ShouldBe("AUT_ID");

                pkColumnFor = emptyContext1.PrimaryKeyColumnFor(typeof(Post));
                pkColumnFor.ShouldBe("Post_Id");
            }
        }