C# Interface method not saving in .dll, is not member of interface
c#
Solution
Try implementing the feature implicitly rather than explictly, otherwise you will only see it when your object is cast to IDepartmentDataSource:
public interface IDepartmentDataSource
{
IQueryable<Employee> Employees { get; }
IQueryable<Department> Departments { get; }
void Save();
}
public class TestClass : IDepartmentDataSource
{
public IQueryable<Employee> Employees
{
get { /* TODO: */}
}
public IQueryable<Department> Departments
{
get { /* TODO: */ }
}
public void Save()
{
//TODO:
}
}
Problem
I keep receiving a "is not member of interface" for a method that I put in an interface, see code below: ``` public interface IDepartmentDataSource { IQueryable<Employee> Employees { get; } IQueryable<Department> Departments { get; } void Save(); } ``` Then I implement the interface and use it like this, ``` void IDepartmentDataSource.Save() { SaveChanges(); } ``` This is when I get the error, I can see the Employees and Departments, but not the save. When I go to the metadata for the definition, I do not see the Void Save() in there either, But it is in my Interface file. Can someone shed a little light, thanks. UPDATE:: This is what I see when I say navigate to definition, even if I delete the .dll and rebuild, I receive the same thing. ``` #region Assembly eManager.Domain.dll, v1.0.0.0 // C:\PluralSight\eManager\eManager.Web\bin\eManager.Domain.dll #endregion using System.Linq; namespace eManager.Domain { public interface IDepartmentDataSource { IQueryable<Department> Departments { get; } IQueryable<Employee> Employees { get; } } } ```