我使用Net Core 2.2,请帮助我在.net中扩展 我有
interface IBaseService<TDataContext, TEntity>
{
TEntity Insert(TEntity objectToInsert);
TEntity Update(TEntity objectToInsert);
}
Class BaseService<TDataContext, TEntity>:IBaseService<TDataContext, TEntity>
{
public TEntity Insert(TEntity objectToInsert) {
/*action Insert in BaseService */
}
public TEntity Update(TEntity objectToInsert) {
/*action Update in BaseService */
}
}
interface IUserService<TDataContext, TEntity>: IBaseService<TDataContext, TEntity>
{
TEntity SEARCH(TEntity objectToInsert);
}
如何使用UserSerice和IUserService扩展类,而不实现更新,插入,仅实现新方法SEARCHIn类
Class UserSerice<TDataContext, TEntity>:IUserService<TDataContext, TEntity>
{
public TEntity Search(TEntity objectToInsert){
/*SEARCH ACTION*/
}
//I want use action Insert / Update in BaseService
/*
public TEntity Insert(TEntity objectToInsert);
public TEntity Update(TEntity objectToInsert);
*/
}