DependencyResolver.Current.GetService
<p>I am trying to implement a grid using MVCGrid.net </p>

<p>In the MVCGridConfig.cs they have something like this</p>

<pre><code> .WithRetrieveDataMethod((context) =&gt;
         {
             var options = context.QueryOptions;
             int totalRecords;
             var repo = DependencyResolver.Current.GetService&lt;IPersonRepository&gt;();
             ...
          }
</code></pre>

<p>I do not quite understand this IPersonRepository. Please let me know what this  interface is supposed to do?</p>

<p>Initially I was using WebGrid, where I was passing List of customer to the view and in the view had IEnumerable to view the grid. If the user had a search term, I would pass that search term to the controller which would accordingly return list of customers matching the search term.</p>

<p>I am not able to relate how to implement the WebGrid logic into this WithRetrieveDataMethod. Specifically, what I should do about that interface.</p>

<p>Also, if there is a search term being passed from the view, how can I change the WithRetrieveDataMethod.</p>