title: How to initialize a TypeORM Repository based on a Generic Type "T"?
body: <p>I would like to Initiate a TypeORM Repository based on a Generic Type.</p>
  
  <p>for instance:</p>
  
  <pre><code>import { Connection, Repository } from 'typeorm';
  
  export class GenericService&lt;T&gt; {
      private repository: Repository&lt;T&gt;;
  
      constructor(connection: Connection) {
          this.repository = connection.getRepository(T);
          // 'T' only refers to a type, but is being used as a value here.ts(2693)
      }
  
      public async list(): Promise&lt;T[]&gt; {
          return await this.repository.find();
      }
  
  }
  </code></pre>
  
  <p>But I was not able to pass Generic Type to the ORM Repository Factory.</p>
  
  <blockquote>
    <p>'T' only refers to a type, but is being used as a value here.ts(2693</p>
  </blockquote>
  
  <p>How can I create this generic service based on the Generic Type?</p>
  
  <p>PS. I did exactly this with C# and works like a charm. it saves me a lot of time</p>