Exemple #1
0
        static void Main(string[] args)
        {
            var myContext = MyDbContext.Create();

            var userRepository = new EFUserRepository(myContext);
            var program        = new Program(userRepository);

            program.CreateUser("smith");

            // 리포지토리에서 데이터를 꺼내 확인한다
            var head = myContext.Users.First();

            Assert.AreEqual("smith", head.Name);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var myContext = MyDbContext.Create();

            var userRepository = new EFUserRepository(myContext);
            var program        = new Program(userRepository);

            program.CreateUser("naruse");

            // データを取り出して確認
            var head = myContext.Users.First();

            Assert.AreEqual("naruse", head.Name);
        }