Exemplo n.º 1
0
        public void delete_with_default_schema()
        {
            using (var db = new DefaultSchemaContext("someDefaultSchema"))
            {
                var sql = db.Posts
                          .Where(x => x.Id == 1)
                          .GenerateBulkDeleteSql();

                Assert.Equal(@"DELETE FROM [someDefaultSchema].[Posts]
WHERE [Posts].[Id] = 1;", sql, false, true, false);
            }
        }
Exemplo n.º 2
0
        public void update_with_default_schema()
        {
            using (var db = new DefaultSchemaContext("someDefaultSchema"))
            {
                var sql = db.Posts
                          .Where(x => x.Id == 1)
                          .SetField(x => x.IsPinned).WithValue(true)
                          .SetField(x => x.IsHighlighted).WithValue(true)
                          .GenerateBulkUpdateSql();

                Assert.Equal(@"UPDATE [someDefaultSchema].[Posts]
SET [Posts].[IsPinned] = {0}, 
    [Posts].[IsHighlighted] = {1}
WHERE [Posts].[Id] = 1;", sql, false, true, false);
            }
        }