mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Add demo
This commit is contained in:
@@ -22,6 +22,26 @@ namespace OrmTest
|
|||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
|
|
||||||
db.Insertable(new ORDER() { Name = "a" }).ExecuteCommand();
|
db.Insertable(new ORDER() { Name = "a" }).ExecuteCommand();
|
||||||
|
|
||||||
|
|
||||||
|
db.Updateable(new Order()
|
||||||
|
{
|
||||||
|
CustomId = 1,
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
Id = 1,
|
||||||
|
Price = 1,
|
||||||
|
Name = "a"
|
||||||
|
}).ExecuteCommand();
|
||||||
|
|
||||||
|
db.Updateable(new List<Order>(){ new Order()
|
||||||
|
{
|
||||||
|
CustomId = 1,
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
Id = 1,
|
||||||
|
Price = 1,
|
||||||
|
Name = "a"
|
||||||
|
} }).ExecuteCommand();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Order
|
public class Order
|
||||||
@@ -33,7 +53,7 @@ namespace OrmTest
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public decimal Price { get; set; }
|
public decimal Price { get; set; }
|
||||||
[SugarColumn(InsertServerTime =true)]
|
[SugarColumn(InsertServerTime =true,UpdateServerTime =true)]
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public int CustomId { get; set; }
|
public int CustomId { get; set; }
|
||||||
|
Reference in New Issue
Block a user