title: MVC5 with EF6 Repository Pattern implementation for Functions and Procedures
body: <p>I'am implementing repository pattern in my large ASP.NET MVC5 application .Every think is fine with tables and views but I'm a little bit confuse how to make repository for functions and procedures that are imported like methods.</p>
  
  <pre><code>_context.spGetSomething(1,"name");
  </code></pre>
  
  <p>The all repository for functions and procedures that I found were using sql command or sql query. Is there any example of good practice with imported procedures ?</p>
  
  <p>My Repository look like this now</p>
  
  <pre><code>interface IRepository&lt;T&gt;:IDisposable
  {
   void Delete(int ID);
   void Update(T entity)
   void Insert(T entity)
   IQueryable Select()
  }
  
  
  
  public abstract class AbstractRepository&lt;T&gt;:IRepositori&lt;T&gt;
  {
           protected MyDbContext context;
           public AbstractRepository(MyDbContext db)
           {
           context= db;
           }
  
    //interface implementation
  }
  </code></pre>
  
  <p>And in controller </p>
  
  <pre><code>public MyController:Controller
  {
   private IRepository&lt;MyModel&gt; _repository;
   MyController()
  {
   _repository= new MyRepository(dbcontext);
  }
  // some actions 
  
  }
  </code></pre>