1234567891011121314151617181920212223242526272829303132 |
- using SqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using Uninpho.DBOperation.Model;
- namespace Uninpho.DBOperation.Operation
- {
- public class Demo4_Deleteable
- {
- public static void Test()
- {
- SqlSugarClient db = Config.GetPgClient();
- //by entity
- db.Deleteable<User>().Where(new User() { Id = 1111 }).ExecuteCommand();
- //by primary key
- db.Deleteable<User>().In(1111).ExecuteCommand();
- //by primary key array
- db.Deleteable<User>().In(new int[] { 1111, 2222 }).ExecuteCommand();
- //by expression
- db.Deleteable<User>().Where(it => it.Id == 11111).ExecuteCommand();
- Console.WriteLine("#### Deleteable End ####");
- }
- }
- }
|