Source/Providers/NFX.MySQL/MySQLCRUDScriptQueryHandler.cs
/// <summary>
/// Populates MySqlCommand with parameters from CRUD Query object
/// Note: this code was purposely made provider specific because other providers may treat some nuances differently
/// </summary>
Populates MySqlCommand with parameters from CRUD Query object
Note: this code was purposely made provider specific because other providers may treat some nuances differently
Populates MySqlCommand with parameters from CRUD Query object Note : this code was purposely made provider specific because other providers may treat some nuances differently
public void PopulateParameters(MySqlCommand cmd, Query query)
            {
               foreach(var par in query.Where(p=> p.HasValue))
                cmd.Parameters.AddWithValue(par.Name, par.Value);
               if (query.StoreKey!=null)
               {
                var where = GeneratorUtils.KeyToWhere(query.StoreKey, cmd.Parameters);
                cmd.CommandText += "\n WHERE \n {0}".Args( where );
               }
               CRUDGenerator.ConvertParameters(Store, cmd.Parameters);
            }
public void PopulateParameters ( MySqlCommand cmd , Query query ) { foreach ( var par in query . Where ( p => p . HasValue ) ) cmd . Parameters . AddWithValue ( par . Name , par . Value ) ; if ( query . StoreKey != null ) { var where = GeneratorUtils . KeyToWhere ( query . StoreKey , cmd . Parameters ) ; cmd . CommandText += " \n \n " . Args ( where ) ; } CRUDGenerator . ConvertParameters ( Store , cmd . Parameters ) ; }
Populates MySqlCommand with parameters from CRUD Query object
Note: this code was purposely made provider specific because other providers may treat some nuances differently
Populates MySqlCommand with parameters from CRUD Query object Note : this code was purposely made provider specific because other providers may treat some nuances differently
cmd
MySqlCommand
query
Query