Repository pattern 哪个是工作单元,哪个是存储库?
我有两个接口,我对命名约定感到困惑:Repository pattern 哪个是工作单元,哪个是存储库?,repository-pattern,unit-of-work,Repository Pattern,Unit Of Work,我有两个接口,我对命名约定感到困惑: interface InterfaceA { IDbSet<Patient> Patients { get; } // others like above } interface InterfaceB : InterfaceA { int Commit(); } class DbContext : InterfaceB { public IDbSet<Patient> Patients { get;
interface InterfaceA {
IDbSet<Patient> Patients { get; }
// others like above
}
interface InterfaceB : InterfaceA {
int Commit();
}
class DbContext : InterfaceB {
public IDbSet<Patient> Patients { get; set; }
int Commit() {
return this.SaveChanges();
}
}
接口a{
IDbSet患者{get;}
//其他人如上图所示
}
接口B:接口A{
int提交();
}
类DbContext:InterfaceB{
公共IDbSet患者{get;set;}
int提交(){
返回此参数。SaveChanges();
}
}
我不想把我团队中的其他程序员搞糊涂。哪个接口是工作单元,哪个是存储库?接口A是存储库 原因: 存储库负责持久化数据,InterfaceB没有要持久化的数据的概念