C # interface method not saving in .dll is not a member of the interface

I keep getting “not a member of the interface” for the method I entered into the interface, see the following code:

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 an error message, I can see employees and departments, but not save. When I go to the metadata for the definition, I do not see Void Save () there, but it is in my interface file.

Can someone shed some light, thanks.

UPDATE :: This is what I see when I say "go to definition", even if I remove the DLL and rebuild, I get 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; }
    }
}
+4
source share
2 answers

, , , 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:
    }
}
+6

NSGaga , , , Visual Studio, .dll. , , . DLL, , obj, - , , . , , , .

NSGaga!

0

Source: https://habr.com/ru/post/1541786/


All Articles