Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: No parameterless constructor defined for this object. - WebForms

$
0
0
Here's what I have.
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

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>