public IDbDataParameter AddParameter(IDbCommand command, string name, object value, Type type) { //ServiceRegistration.Get<ILogger>().Info("Adding " + name + "=" + value + "(" + type + ") to " + command); IDbDataParameter parameter = command.CreateParameter(); parameter.ParameterName = name; parameter.Value = value; parameter.DbType = MockDBUtils.GetType(type); command.Parameters.Add(parameter); return(parameter); }
public IDbCommand CreateCommand() { IDbCommand command; if (MockDBUtils.Connection != null) { command = MockDBUtils.Connection.CreateCommand(); command = new LoggingDbCommandWrapper(command); } else { command = new MockCommand(); MockDBUtils.AddCommand((MockCommand)command); } return(command); }
public IDataReader ExecuteReader(CommandBehavior behavior) { return(MockDBUtils.GetReader(_commandText, GetFormattedSql())); }