/// <summary> /// Inserts a new record into the table. /// </summary> /// <param name="db"></param> /// <param name="tableName">Name of the table to insert into.</param> /// <param name="values">The values that will be added to the table. Can be anything that can be converted to a property bag.</param> /// <returns>The newly inserted row.</returns> public static dynamic Insert(this BaDatabase db, string tableName, object values) { var cmd = db.Connection.CreateCommand(); PrepareInsertCmd(cmd, tableName, values); return(db.GetDynamic(cmd)); }
/// <summary> /// Gets the first row as a dynamic object. /// </summary> /// <param name="db"></param> /// <param name="sprocName">Name of the stored procedure to call.</param> /// <param name="parameters">An object that contains the properties to add as SQL parameters to the SQL command.</param> /// <returns></returns> public static dynamic GetDynamic(this BaDatabase db, string sprocName, object parameters = null) { var cmd = db.PrepareSprocCmd(sprocName, parameters); return(db.GetDynamic(cmd)); }