예제 #1
0
        public void SqlQueryEntityFactory()
        {
            var session = new DataSession("Tracker").Log(Console.WriteLine);

            session.Log(Console.WriteLine);
            session.Should().NotBeNull();

            string email = "*****@*****.**";
            string sql   = "select * from [User] where EmailAddress like @EmailAddress";

            var users = session.Sql(sql)
                        .Parameter("@EmailAddress", email)
                        .Query <User>();

            users.Should().NotBeNull();
            users.Should().NotBeEmpty();
        }
예제 #2
0
        public void SqlQueryEntityFactory()
        {
            var session = new DataSession("Tracker").Log(Console.WriteLine);
            session.Log(Console.WriteLine);
            session.Should().NotBeNull();

            string email = "*****@*****.**";
            string sql = "select * from [User] where EmailAddress like @EmailAddress";

            var users = session.Sql(sql)
                .Parameter("@EmailAddress", email)
                .Query<User>();

            users.Should().NotBeNull();
            users.Should().NotBeEmpty();
        }