DAG
DAG

Reputation: 2630

WCF - same parameter to all service methods

I haven't been working with WCF for ages, now we are developing a Service and its methods receive all the same parameter. Is there a way, that I can pass this parameter throughout a ServiceContext so I don't need to repeat this parameter in every WCF method? My client is a WebApi application.

Upvotes: 2

Views: 420

Answers (2)

Bhaktuu
Bhaktuu

Reputation: 89

You can pass the additional parameters as OutgoingMessageHeaders in OperationContext which will be accessible in every method.

Upvotes: 2

Related Questions