我在 c# 中乞求。在所有这堂课中,“哪里”是什么意思?为什么我在代码中使用“where”?Where关键字有什么好处?
public abstract class AbstractEntity
{
}
public abstract class AbstractControl<E> where E: AbstractEntity
{
public abstract void Add(E entity);
public abstract void Modify(E entity);
public abstract void Remove(E entity);
}
public abstract class AbstractSQLServerControl<E> : AbstractControl<E> where E : AbstractEntity
{
protected SQLServerConnectionManager connectionManager;
public AbstractSQLServerControl(string connectionString)
{
connectionManager = new SQLServerConnectionManager(connectionString);
}
}