//转成list List<Student> list1 = db.SqlQuery<Student>(); //转成list带参 List<Student> list2 = db.SqlQuery<Student>(, new { id = 1 }); list3 = db.SqlQueryDynamic(); list4 = db.SqlQueryJson(); list5 = db.SqlQuery<).SingleOrDefault(); //反回键值 Dictionary<).ToDictionary(it => it.Key, it => it.Value); list7 = db.SqlQuery<).SingleOrDefault(); spResult = db.SqlQuery<School>(, new { p1 = 1, p2 = 2 }); pars = SqlSugarTool.GetParameters(new { p1 = 1,p2=0 }); //将匿名对象转成SqlParameter db.IsClearParameters = false;//禁止清除参数 pars[spResult2 = db.SqlQuery<School>(, pars); db.IsClearParameters = outPutValue = pars[1].Value;//获取output @p2的值 v1 = db.GetString(); ); ); );
3、SQL高级拼接器写法