File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public void GetEntity()
3232 [ Fact ]
3333 public void QueryBySql ( )
3434 {
35- var list = _repository . QueryBySql ( ) ;
35+ var list = _repository . QueryBySql ( 10 ) ;
3636 }
3737 [ Fact ]
3838 public void QueryDataTable ( )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public interface IEntityRepository : IRepository<T_Entity>
2222 [ Statement ( Id = "MultiQuery" ) ]
2323 DataSet QueryDataSet ( ) ;
2424
25- [ Statement ( Sql = "Select Top 6 T.* From T_Entity T With(NoLock);" ) ]
26- IEnumerable < T_Entity > QueryBySql ( ) ;
25+ [ Statement ( Sql = "Select Top(@Taken) T.* From T_Entity T With(NoLock);" ) ]
26+ IEnumerable < T_Entity > QueryBySql ( int Taken ) ;
2727 }
2828}
Original file line number Diff line number Diff line change @@ -92,6 +92,19 @@ public void ExecuteScalar()
9292 var total = _sqlMapper . ExecuteScalar < long > ( context ) ;
9393 }
9494
95+ [ Fact ]
96+ public void QueryBySql ( )
97+ {
98+ RequestContext context = new RequestContext
99+ {
100+ RealSql = "Select Top(@Taken) T.* From T_Entity T With(NoLock);" ,
101+ Request = new
102+ {
103+ Taken = 10
104+ }
105+ } ;
106+ var list = _sqlMapper . Query < T_Entity > ( context ) ;
107+ }
95108
96109 [ Fact ]
97110 public void Query ( )
You can’t perform that action at this time.
0 commit comments