Exemple #1
0
        public void TsQueryNot()
        {
            using (var context = new BloggingContext(ConnectionString))
            {
                context.Database.Log = Console.Out.WriteLine;

                context.Blogs.Add(new Blog {
                    Name = "_"
                });
                context.SaveChanges();

                var result = context.Blogs.Select(
                    x => NpgsqlTextFunctions.QueryNot(NpgsqlTextFunctions.AsTsQuery("cat"))).First();

                Assert.That(
                    NpgsqlTsQuery.Parse(result).ToString(),
                    Is.EqualTo(NpgsqlTsQuery.Parse("! 'cat'").ToString()));
            }
        }