0

Can a class have a "Service Contract" attribute and its methods "Operation Contract". Or do these need to be applied to an interface which the class would have to implement?

1 Answer 1

1

You can place the ServiceContract and OperationContract attributes on a class, but that is considered bad practice. It's better to abstract out to an interface and then place the attributes (that are contract related, not implementation related, as those do exist in WCF) on the contract.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.