title: ASP.NET MVC Possible to have an interface as model in view?
body: <p>Say that I have the following interface:</p>
  
  <pre><code>public interface IUserListVM
  {
       IList&lt;string&gt; UserList { get; }
  }
  </code></pre>
  
  <p>and a view model implementing this view model interface:</p>
  
  <pre><code>public class UserListVM : IUserListVM
  {
      private IList&lt;string&gt; userList = new List&lt;string&gt;();
  
      IList&lt;string&gt; UserList
      {
          get { return userList; }
      }
  }
  </code></pre>
  
  <p>is it then possible to have a view that expects a model that inherits the IUserListVM.
  Say that I have a UserList partial view that looks something like this:</p>
  
  <pre><code> @model MVCWebsite.Views.IUserListVM
  
   @foreach (string user in Model.UserList) {
       user
   }
  </code></pre>
  
  <p>The meaning of this is to have partial views as standalone as possible.</p>