Beispiel #1
0
 public FindContext(string ConnectionString, DBType DBType)
 {
     _ConnectionString = ConnectionString;
     dbhelper          = new DBHelper(_ConnectionString, DBType);
     sqlstring         = new Context.FindSqlString <T>();
     jss = new JavaScriptSerializer();
 }
Beispiel #2
0
        public DataTable Find <M>(M entity, string OrderBy) where M : BaseModel, new()
        {
            sqlstring         = new Context.FindSqlString <T>();
            sqlstring.OrderBy = OrderBy;
            var sql = this.GetSql(entity);

            return(dbhelper.ExecuteDataset(sql));
        }
Beispiel #3
0
        public List <M> FindToList <M>(M entity, string OrderBy) where M : BaseModel, new()
        {
            sqlstring         = new Context.FindSqlString <T>();
            sqlstring.OrderBy = OrderBy;
            var sql = this.GetSql(entity);
            var dt  = dbhelper.ExecuteDataset(sql);

            return(this.FindToList <M>(dt));
        }