标签:style blog http color io ar sp div on
var args = new DynamicParameters(new {}); if (obj.orderId != null) { sb.Append(" AND OrderId = @OrderId"); args.Add("OrderId", obj.orderId); } if (obj.clientName != null) { sb.Append(" AND b.Name = @ClientName"); args.Add("ClientName", obj.clientName); } conn.Query<TModel>(sql, args );
参考:
http://stackoverflow.com/questions/22978754/send-sqlparameter-to-dapper
标签:style blog http color io ar sp div on
原文地址:http://www.cnblogs.com/starluck/p/3999255.html