DbFramework数据库实体框架新增几个方法
DbFramework数据库实体框架新增几个方法
C# 全选
var conn = "Server=.;Database=CSFrameworkV5_Normal;User ID=sa;Password=test; Max Pool Size=512; Pooling=true;Connect Timeout=30";
IDatabase db = DatabaseFactory.CreateSqlDatabase(conn);
//isid是自增字段
sys_Log log = new sys_Log
{
DocNo = "doc0123412341234",
GUID32 = "2345234523452435",
LogDate = DateTime.Now,
LogUser = "admin",
OPType = 1,
};
new DbFramework(db).AddObject<sys_Log>(log, new string[] { "isid", "DocNo" });//旧的使用方法
new DbFramework(db).AddObject<sys_Log>(log, "isid", "DocNo"); //新方法:params 参数形式
List<sys_Log> list = new DbFramework(db).Select<sys_Log>();//新增功能:返回所有对象
sys_Log one = new DbFramework(db).Select<sys_Log>("isid", 1);//新增功能:根据关键字返回一个对象
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网