private void Execute(IHandleStrategy strategy) { using (SqlConnection connection = CreateConnection()) { SqlCommand command = CreateCommand(connection); Dictionary <string, SqlParameter> p = Parameters.ToSqlParameters(); AddParametersToCommand(command, p); connection.Open(); strategy.Execute(command); Parameters.UpdateValues(p); } }
private IHandleStrategy handleStrategy; //currently used handling strategy public ConcreteRequestHandler(IHandleStrategy handleStrategy) //conctructs new instance with given strategy { this.handleStrategy = handleStrategy; }