FreeJobAlert

FreeJobAlert.Com

Government Jobs | Results | Admit Cards

Advertisement

What is service contract? Could we able to inherit service contract?

The Service Contract Attribute, defined in the System.ServiceModel namespace, can be applied to either .NET interfaces or .NET classes.It is used to declare the type as a Service contract.
service contract attribute is not inherited, so if the interface or class you are using to define your Service contract inherits from another Service contract, you must explicitly use the ServiceContract-Attribute to declare the subtype as a Service contract as well.
Syntax to declare Service Contract
' VB _ Public Interface ITaskManagerService ' Etc... End Interface // C# [ServiceContract(Name = "TaskManagerService", Namespace = "http://schemas.fabrikam.com/2008/04/tasks/")] public interface ITaskManagerService { // Etc... }

Tags: wcf basics, wcf interview questions, wcf in .net, wcf service, wcf service contract