Programmatically set InstanceContextMode

前端 未结 3 1012
死守一世寂寞
死守一世寂寞 2021-02-06 21:52

Is there a way to do this ...

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]

...pro

3条回答
  •  心在旅途
    2021-02-06 22:10

    We can also use the ServiceBehaviourAttribute at the Service class in order to set the InstanceContextMode as below:

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
    ConcurrencyMode = ConcurrencyMode.Multiple)]
    public class MyService : IMyService
    {
    //service code
    }
    

提交回复
热议问题