I'm getting this error after giving deploy(AWS)
of my WebApi
.
<ExceptionMessage> An error occurred when trying to create a controller of type 'LivroController'. Make sure that the controller has a parameterless public constructor. </ExceptionMessage>
My controller
:
public class LivroController : BaseODataController<Livro>
{
public LivroController() : base()
{}
}
My Base OdataController
:
public class BaseODataController<TEntity> : ODataController,
IBaseController<TEntity> where TEntity : class
{
private readonly IRepositoryBase<TEntity> Repository;
public BaseODataController()
{
Repository = new RepositoryBase<TEntity>();
}
[EnableQuery]
public IList<TEntity> Get()
{
return Repository.Get().ToList();
}
}
I've already put an empty constructor in LivroController
, but it still has the error .