mardi 2 décembre 2014

"Does not contain a definition" Error on method in interface


Vote count:

0




I have an interface that is structured like this



public interface IDataContextAsync : IDataContext
{
void DisableGlobalFilter(string filterName);
}


I have a class the uses the interface like this



public class Repository<TEntity> : IRepositoryAsync<TEntity> where TEntity : class, IObjectState
{
private readonly IDataContextAsync _context;

public Repository(IDataContextAsync context)
{
_context = context;
}

public void DisableGlobalFilter(string filterName)
{
_context.DisableGlobalFilter(filterName);
}
}


When I try to compile I get the following Error



'Repository.Pattern.DataContext.IDataContextAsync' does not contain a definition for 'DisableGlobalFilter' and no extension method 'DisableGlobalFilter' accepting a first argument of type 'Repository.Pattern.DataContext.IDataContextAsync' could be found (are you missing a using directive or an assembly reference?)



What's strange is that Visual Studio shows intelisense as correctly. I can also "Go To Definition" from the class to the interface correctly.



asked 23 secs ago







"Does not contain a definition" Error on method in interface

Aucun commentaire:

Enregistrer un commentaire