1
Reply

WCF service interface

Rajesh Singh

Rajesh Singh

Apr 20 2016 8:17 AM
375
Is it possible to declare method in service interface without operationcontract attribute?
Example is mention below. 
 
[ServiceContract]
interface IService
{
[OperationContract]
void Display();
 
//Without Operation contract 
void Show();
}
class Service : IService
{
public void Display()
{
   throw new NotImplementedException();
}
public void Show()
{
throw new NotImplementedException();
}
}
 
1. If yes then what is use of it. 
 
Interviewer asked me this question recently. Please help me.
 

Answers (1)