# C1.LiveLinq.IndexedQueryExtensions.AsIndexed

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_LiveLinq_IndexedQueryExtensions_AsIndexed_" data-uid="C1.LiveLinq.IndexedQueryExtensions.AsIndexed*">AsIndexed Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_LiveLinq_IndexedQueryExtensions_AsIndexed_" data-uid="C1.LiveLinq.IndexedQueryExtensions.AsIndexed*"></a>
<h4 id="C1_LiveLinq_IndexedQueryExtensions_AsIndexed__1_C1_LiveLinq_Indexing_IIndexedSource___0__" data-uid="C1.LiveLinq.IndexedQueryExtensions.AsIndexed``1(C1.LiveLinq.Indexing.IIndexedSource{``0})">AsIndexed&lt;T&gt;(IIndexedSource&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Returns the input typed as <a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static IIndexedSource&lt;T&gt; AsIndexed&lt;T&gt;(this IIndexedSource&lt;T&gt; source)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function AsIndexed(Of T)(source As IIndexedSource(Of T)) As IIndexedSource(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource</a>&lt;T&gt;</td>
      <td><span class="parametername">source</span></td>
      <td><p>The collection to type as <a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource</a>&lt;T&gt;</td>
      <td><p>The input collection typed as <a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the elements of <i>source</i>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_LiveLinq_IndexedQueryExtensions_AsIndexed__1_C1_LiveLinq_Indexing_IIndexedSource___0___remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method has no effect other than to change the compile-time type of <i>source</i> from a type that
implements <a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a> to <a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a> itself.
It is used to choose between query implementations when a collection implements
<a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a> but also has a different set of public query methods available.</p>
<p>The main scenario is when you want to perform queries on live views without creating new live views.</p>
<p> Live views have their own implementations of query operators defined in the <a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View&lt;T&gt;</a> class.
Live view implementations are heavier, require more resources, so it is not recommended to use live view implementations
in cases where you don't need live view functionality (for example, for querying read-only collections),
see <span style="C1H Jump">Live View Performance</span>. If you have a live view, but want to query it using operators
from <a class="xref" href="C1.LiveLinq.IndexedQueryExtensions.html">IndexedQueryExtensions</a> instead of <a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View&lt;T&gt;</a>, use this method to
"downgrade" the live view to an <a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a>. This method does not cause the live view to lose its
"live" functionality, it simply returns the live view's implementation of the <a class="xref" href="C1.LiveLinq.Indexing.IIndexedSource-1.html">IIndexedSource&lt;T&gt;</a> interface.</p>
</div>
</div>
