I write this Interface to create and terminating a session.
[ServiceContract(SessionMode = SessionMode.Required)]
public interface IOrdersService
{
[OperationContract(IsInitiating = true, IsTerminating = false)]
void EmptyCart();
[OperationContract(IsInitiating = false,IsTerminating = false)]
void AddToCart(CartItem cartItem);
}
it`s work fine. But when a session timeout then how can i detect ??
If it is trimmed out, your channel will be faulted both on your client and your server's callback channel, you can listen on faulted event on channel. And once it is faulted, you will need to recreate a channel to recover.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With