behzadk
شنبه 06 آذر 1389, 08:25 صبح
با سلام
من چطور می تونم این کلاس رو Serialize کنم
با تشکر فراوان
public static ShoppingCart GetShoppingCart()
{
BinaryFormatter bf = new BinaryFormatter();
if (HttpContext.Current.Session["ShoppingCart"] == null)
{
ShoppingCart MyShopCart = new ShoppingCart();
MyShopCart.Items = new List<CartItem>();
HttpContext.Current.Session["ShoppingCart"] = MyShopCart;
}
return (ShoppingCart)HttpContext.Current.Session["ShoppingCart"];
}
من چطور می تونم این کلاس رو Serialize کنم
با تشکر فراوان
public static ShoppingCart GetShoppingCart()
{
BinaryFormatter bf = new BinaryFormatter();
if (HttpContext.Current.Session["ShoppingCart"] == null)
{
ShoppingCart MyShopCart = new ShoppingCart();
MyShopCart.Items = new List<CartItem>();
HttpContext.Current.Session["ShoppingCart"] = MyShopCart;
}
return (ShoppingCart)HttpContext.Current.Session["ShoppingCart"];
}