Here's what I have.
in the global.asax
protected void Application_Start(object sender, EventArgs e)
{
public class Bootstrapper
{
public static void Configure(IUnityContainer container)
{
}
public Repository(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
{
But, when I bind the Service Layer to a Grid, I get - "the repository does not contain a constructor that take 0 arguments". The breakpoint in the service layer is never hit.
also, where/how do i set the context connection string
in the global.asax
protected void Application_Start(object sender, EventArgs e)
{
IUnityContainer container = Application.GetContainer();
Bootstrapper.Configure(container);
}public class Bootstrapper
{
public static void Configure(IUnityContainer container)
{
container
.RegisterType<IDataContextAsync, FESWebContext>()
.RegisterType<IUnitOfWorkAsync, UnitOfWork>()
.RegisterType<IRepositoryAsync<FES.Models.Account>, Repository<FES.Models.Account>>()
.RegisterType<IAccountService, AccountService>();
}}
public Repository(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
{
_context = context;
_unitOfWork = unitOfWork;
var dbContext = context as DbContext;
if (dbContext != null)
{
_dbSet = dbContext.Set<TEntity>();
}
} But, when I bind the Service Layer to a Grid, I get - "the repository does not contain a constructor that take 0 arguments". The breakpoint in the service layer is never hit.
also, where/how do i set the context connection string