没有多重继承。但是我的项目伙伴使用接口来实现add, remove
等方法。
这是代码:
public interface IAccountCategoryDataSource
{
bool Add(AccountCategory accountCategory);
bool Update(AccountCategory accountCategory);
bool Remove(AccountCategory accountCategory);
AccountCategory GetById(int id);
AccountCategory GetByName(string name);
IEnumerable<AccountCategory> GetByParentCategory(AccountCategory category);
IEnumerable<AccountCategory> GetTopLevelCategories();
IEnumerable<AccountCategory> GetBySearchTerm(string searchTerm);
IEnumerable<AccountCategory> GetAll();
event EventHandler<ObjectAddedEventArgs> AccountCategoryAdded;
event EventHandler<ObjectUpdatedEventArgs> AccountCategoryUpdated;
event EventHandler<ObjectRemovedEventArgs> AccountCategoryRemoved;
}
请解释接口的需要是什么。