I have an interface IRepository
to abstract my repository. DbContext
class is an Entity Framework to work with First Code.
public interface IRepository
{
IQueryable<User> Users { get; }
}
public class Repository : DbContext, IRepository
{
public DbSet<User> Users { get; set; }
IQueryable<User> IRepository.Users { get{ return Users; } }
}
I did not understand the User
property user in Repository
class.
This code compiles, I wonder why.
What is the interface name before the name of the property?