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

                var blog = new Blog
                {
                    Name = "cooky cookie cookies piano pianos"
                };
                context.Blogs.Add(blog);
                context.SaveChanges();

                var strippedTsVector = context
                                       .Blogs
                                       .Select(x => NpgsqlTextFunctions.Strip(NpgsqlTextFunctions.ToTsVector(x.Name)))
                                       .FirstOrDefault();

                Assert.That(
                    NpgsqlTsVector.Parse(strippedTsVector).ToString(),
                    Is.EqualTo(NpgsqlTsVector.Parse("'cooki' 'piano'").ToString()));
            }
        }