mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 02:39:14 +08:00
4.6.1
This commit is contained in:
@@ -15,8 +15,10 @@ namespace OrmTest.Demo
|
||||
Name = "attr"
|
||||
};
|
||||
db.Insertable(a).AS("student").ExecuteCommand();
|
||||
|
||||
var list = db.Queryable<AttributeTest>().AS("student").Select(it => new AttributeTest() { Aid = it.Aid + 1,CreateTime=DateTime.Now,Name=it.Name }).ToList();
|
||||
var list = db.Queryable<AttributeTest>().AS("student").ToList();
|
||||
var list2 = db.Queryable<AttributeTest>().AS("student").Select(it => new AttributeTest() { Aid = it.Aid + 1,CreateTime=DateTime.Now,Name=it.Name }).ToList();
|
||||
var s = new AttributeTest2() { Aid = 1,AName="a", CreateTime=DateTime.Now };
|
||||
var count = db.Updateable(s).UpdateColumns(it=>new { it.CreateTime,it.AName }).Where(it=>it.Aid==100).ExecuteCommand();
|
||||
}
|
||||
|
||||
public class AttributeTest
|
||||
@@ -27,5 +29,15 @@ namespace OrmTest.Demo
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
[SugarTable("student")]
|
||||
public class AttributeTest2
|
||||
{
|
||||
[SugarColumn(ColumnName = "Id")]
|
||||
public int Aid { get; set; }
|
||||
[SugarColumn(ColumnName = "Name")]
|
||||
public string AName { get; set; }
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user