title: Razor. How to use partial view with IQueryable?
body: <p>I'm completely new to Razor engine, so may be my question look silly. Anyway. I need to use partial view in main view and I'm passing my model that inherited IQueryable interface.
  This look like that:</p>
  
  <pre><code> @{Html.RenderPartial("~/Views/comments/Details.cshtml", new IQueryable&lt;BlogAspNetMVC.Models.comments&gt;);}
  </code></pre>
  
  <p>Partial view model:</p>
  
  <pre><code>@model IQueryable&lt;BlogAspNetMVC.Models.comments&gt;
  </code></pre>
  
  <p>How should I change RenderPartial to be able accept this model as argument?</p>
  
  <p>P.S.
  Here is comments model:</p>
  
  <pre><code>  public partial class comments
      {
          public int ID { get; set; }
          public string Comment { get; set; }
          public Nullable&lt;int&gt; Author { get; set; }
          public Nullable&lt;System.DateTime&gt; Posted { get; set; }
          public Nullable&lt;int&gt; PostID { get; set; }
  
          public virtual blog_post blog_post { get; set; }
      }
  </code></pre>
  
  <p>Here is Icomments interface:</p>
  
  <pre><code>public interface IComments : IDisposable
  {
      IQueryable&lt;comments&gt; GetPostComments(int postid);
      //void Add(comments comment);
      //void Update(comments comment);
      //void Remove(int id);
  }
  </code></pre>
  
  <p>This how implemented in repository:</p>
  
  <pre><code>public IQueryable&lt;comments&gt; GetPostComments(int postid)
          {
              var all = from a in db.comments
                        orderby a.Posted descending
                        where a.PostID == postid
                        select a;
              return all.AsQueryable();
          }
  </code></pre>