二、添加 Insert into
文档目录
开始使用 初始化查询实例:
LambdaToSql.SqlClient DB = new LambdaToSql.SqlClient();
添加实体数据
var log = new EntityModel.Log() { Guid = Guid.NewGuid(), Client = "91", IP = "127.0.0.3", Browser = "IE", CityLevels = "沈阳", Description = "说明" };
int i= DB.InsertTble(log).ExecuteNonQuery();//返回影响的行数
只添加某几列
var log = new EntityModel.Log() { Guid = Guid.NewGuid(), Client = "91", IP = "127.0.0.3", Browser = "IE", CityLevels = "沈阳", Description = "说明" };
int i = DB.InsertTble(log).InsertColumns(ex => new { ex.Guid, ex.Description, ex.CityLevels }).ExecuteNonQuery();
忽略某些列
var log = new EntityModel.Log() { Guid = Guid.NewGuid(), Client = "91", IP = "127.0.0.3", Browser = "IE", CityLevels = "沈阳", Description = "说明" };
int i = DB.InsertTble(log).IgnoreColumns(ex => new { ex.Guid, ex.Description, ex.CityLevels }).ExecuteNonQuery();