Esempio n. 1
0
 public DynamicDatabaseQueryContext(string table, DynamicDatabase <Db> dynamicDb)
 {
     this.DynamicDatabase = dynamicDb;
     this.TableName       = table;
     this.Columns         = "*";
     this.ParameterPrefix = "@";
 }
Esempio n. 2
0
        /// <summary>
        /// Execute the specified sql using the specified parameters
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public static IEnumerable <dynamic> ExecuteSqlQuery(this string sql, Database db, Dictionary <string, object> parameters = null)
        {
            DynamicDatabase ddb = new DynamicDatabase(db);

            return(ddb.Query(sql, parameters ?? new Dictionary <string, object>()));
        }