Rajesh Singh

Rajesh Singh

  • 821
  • 997
  • 850.3k

WCF service interface

Apr 20 2016 8:17 AM
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)