public partial class shoppingCart : ISecurisable
{
public void Deactivate()
{
shoppingCartid = null;
IsActive = false;
foreach (var shoppingCartDetails in Childs)
{
shoppingCartDetails.ParentId = ParentId;
}
}
}
在课程中实现了ISecurisable后,如何访问Deactivate()
方法。
答案 0 :(得分:2)
首先创建ShoppingCart
- 类
ShoppingCart cart = new ShoppingCart();
现在调用方法
cart.Deactivate();
答案 1 :(得分:0)
您可以使用此表单
ISecurisable shoppingCart = new shoppingCart();
shoppingCart.Deactivate();
public interface ISecurisable
{
void Deactivate();
}
public partial class shoppingCart : ISecurisable
{
public void Deactivate()
{
shoppingCartid = null;
IsActive = false;
foreach (var shoppingCartDetails in Childs)
{
shoppingCartDetails.ParentId = ParentId;
}
}
}