I would like to make a database call in a partial view in asp.net MVC. I am not sure how to actually go about that. I am trying to get an instance of the repository so I can make a couple calls to the DB to build some info on the page. Not sure if I am even close but does anyone have any ideas ?
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
if (Request.IsAuthenticated)
{
var repos = MyMVC.Models.Repository.IRepository<UserProfile>();
}
%>