title: How to realese Dispose() on RabbitMQ without using. C#
body: <p>I have my sender class.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public class RabbitSender
      {
          private ConnectionFactory _factory;
          private IConnection _connection;
          private IModel _channel;
  
          public RabbitSender()
          {
              _factory = new ConnectionFactory() { HostName = "localhost" };
              _connection = _factory.CreateConnection();
              _channel = _connection.CreateModel();
              _channel.QueueDeclare(queue: "hello",
                durable: false,
                exclusive: false,
                autoDelete: false,
                arguments: null);
          }
  
          public void Send(SendModel print)
          {
              byte[] messageBody = print.ToByteArray();
  
              _channel.BasicPublish(exchange: "",
               routingKey: "hello",
               basicProperties: null,
               body: messageBody);
          }
  
          public void Send2(SendModel print)
          {
              var factory = new ConnectionFactory() { HostName = "localhost" };
              using (var connection = factory.CreateConnection())
              using (var channel = connection.CreateModel())
              {
                  channel.QueueDeclare(queue: "hello",
                                       durable: false,
                                       exclusive: false,
                                       autoDelete: false,
                                       arguments: null);
                  byte[] messageBody = print.ToByteArray();
  
                  channel.BasicPublish(exchange: "",
                   routingKey: "hello",
                   basicProperties: null,
                   body: messageBody);
              }
          }
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Method <code>Send2()</code> according the documetation on the website of RabbitMQ. As u can see it is using </p>
  
  <p><code>using</code> and with it I dont have problem with memory leak. But in this case I always create new connection when call method Send2().</p>
  
  <p>In case of <code>Send()</code> I create conection once but I did not use <code>using</code> in this case. Because using always close my <code>_channel</code> and I cant send next msg. 
   I try to call <code>_channel.Dispose()</code> after sending but it is the same result such with <code>using</code>. And the main problem if I will not release garbage collector my memory is leaking. In 30 minutes I use 86% of my memory :/. In case <code>Send2()</code> I dont have this problem. How I can realese once creation of connection and after each sending to clean up the garbage without closing _channel?</p>