Instance management refers to the way a service handles a request from a client. Instance management is set of techniques WCF uses to bind client request to service instance, governing which service instance handles which client request.
It is necessary because application will differ in their need for scalability, performance, durability, transaction and queued calls.
There are three instance modes in WCF:
- Per-Call instance mode
- Per-Session instance mode
- Singleton Instance Mode
−Instance mode can be configured using ServiceBehavior attribute. This can be specified at implementing the service contract as shown below.
public interface IPayRollService
public class PayRollService:IPayRollService
public double ProcessSalary()