コード例 #1
0
ファイル: BaseDao.cs プロジェクト: Demon520-coder/ZZL.Dao
 public IEnumerable <T> GetList(object param, string sqlId = "GetList")
 {
     return(sqlMapper.Query <T>(new RequestContext
     {
         Scope = Scope,
         SqlId = sqlId,
         Request = param
     }));
 }
コード例 #2
0
        public override IEnumerable <T_Entity> Query()
        {
            var list = _sqlMapper.Query <T_Entity>(new RequestContext
            {
                Scope   = "Entity",
                SqlId   = "Query",
                Request = new { Taken = QUERY_TAKEN }
            });

            return(list);
        }
コード例 #3
0
 public void Query_ReadDb2()
 {
     var result = _sqlMapper.Query <T_Entity>(new RequestContext
     {
         Scope = Scope,
         SqlId = "Query_ReadDb2"
     });
 }
コード例 #4
0
 public void QueryBySql()
 {
     RequestContext context = new RequestContext
     {
         RealSql = "Select Top(@Taken) T.* From T_Entity T With(NoLock);",
         Request = new
         {
             Taken = 10
         }
     };
     var list = _sqlMapper.Query <T_Entity>(context);
 }
コード例 #5
0
        public void Des()
        {
            RequestContext context = new RequestContext
            {
                Scope   = Scope,
                SqlId   = "Query",
                Request = new { Taken = 10 }
            };

            var list = _smartSqlMapper.Query <T_Entity>(context);
        }
コード例 #6
0
        public static IEnumerable <T> Query <T>(this ISmartSqlMapper sqlMapper, string fullSqlId, dynamic @params, DataSourceChoice sourceChoice)
        {
            EnsurePoint(ref fullSqlId);

            return(sqlMapper.Query <T>(new RequestContext()
            {
                Scope = fullSqlId.Split('.')[0],
                SqlId = fullSqlId.Split('.')[1],
                Request = @params
            }, sourceChoice));
        }
コード例 #7
0
 public IEnumerable <T> Query <T>(RequestContext context)
 {
     return(MapperInstance.Query <T>(context));
 }
コード例 #8
0
 public IEnumerable <T> Query <T>(RequestContext context)
 {
     return(SqlMapper.Query <T>(context));
 }