Reputation:
public partial class shoppingCart : ISecurisable
{
public void Deactivate()
{
shoppingCartid = null;
IsActive = false;
foreach (var shoppingCartDetails in Childs)
{
shoppingCartDetails.ParentId = ParentId;
}
}
}
How can I access the Deactivate()
method after I've implemented ISecurisable on the class.
Upvotes: 2
Views: 53
Reputation: 476
You can use this form
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;
}
}
}
Upvotes: 0
Reputation: 37000
First create an instance of your ShoppingCart
-class
ShoppingCart cart = new ShoppingCart();
Now call the method
cart.Deactivate();
Upvotes: 2