var connstr = configurationmanager.connectionstrings["Dbconnstr"]. ConnectionString;
SqlContext db = new SqlContext (CONNSTR);
List Query
var list1 = db. Getlist<config> (s = s.id > 5);
var list2 = db. Getlist<config> ("select * from Bas_config where ID > @id", NULL, New SqlParameter ("@id", 5));
var list3 = db. Query<config> (). Where (s = = s.id > 5). ToList ();
Multi-Criteria Query
var query = db. Query<config> ();
Query. Where (s = = S.paramtype = = "B");
Query. Where (s = = s.id > 5);
var result = query. ToList ();
Paging Query
var PAGERESULT1 = db. Getpageresult<config> (New SQL. pagehelper.pagebase {PageIndex = 0, PageSize = ten}, s = = S.id, true);
var pageResult2 = db. Getpageresult<config> (New SQL. pagehelper.pagebase {PageIndex = 0, PageSize = ten}, "select * from Bas_config", "Id ASC");
var PAGERESULT3 = db. Query<config> (). Topageresult (New SQL. pagehelper.pagebase {PageIndex = 0, PageSize = ten}, s = = S.id, true);
Insert
int row1 = db. Insert<config> (new Config {paramid = "a", Paramtype = "a", Paramvalue = "A"}, false);
int row2 = db. Insertbatch<config> (New List<config> {
New Config {paramid = "B", Paramtype = "B", paramvalue = "B"},
New Config {paramid = "c", Paramtype = "C", paramvalue = "C"}
});
Update
int update1 = db. Update<config> (new Config {ID = 10033, Paramid = "AAA", Paramtype = "AAA", Paramvalue = "AAA", Remark = "AA"});
int update2 = db. Query<config> (). Set (s = = S.paramid, "AAA"). Set (s = = S.paramtype, "AAA"). Where (s = = S.id = 10033). Update ();
Delete
int delete1 = db. Delete<config> (s = = S.id = = 10033);
int delete2 = db. Query<config> (). Where (s = = S.id = 10033). Delete ();
Szq.orm.sql detailed instructions for use