因为接口不包含静态方法,是否有任何方法可以使强制实现的派生类中的静态方法?有没有什么办法可以使强制实现的派生类中实现静态方法?
如果不是,还有其他方法可以实现这个目标吗?
其实我做我所有的数据库类是这样的:
class MyClass : IMyClass, IPersistant
{
public int ID {get;set}
.....
.....
public int SaveOrUpdate(){}//returns the ID
public static MyClass Get(int id){}
public static IEnumerable<MyClass> Get(){}
public bool Delete(){}
}
你想做什么? – 2009-12-20 14:03:39