Can we use abstract class instead of interface in wcf as servicecontract?
Can we use abstract class instead of interface in wcf as servicecontract? I have searched a lot on internet but didnt find proper answer.
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sam HobbsRank #107 · 20.5K reputationPosted May 22, 2011, 5:20 PM EDT
interface InterfaceBase
{
void Implemented() // error: interface members cannot have a definition
{
Console.WriteLine();
}
void Unimplemented();
}
abstract class classAbstract
{
void Implemented()
{
Console.WriteLine();
}
abstract public void Unimplemented();
}
You can't compile it; you will get an error. I am sorry that I do not know much about WCF and servicecontracts but I assume that a servicecontract cannot have a class with a method that is implemeted. I hope someone will correct me if I am wrong.
DRISHTY134 reputationPosted May 23, 2011, 1:00 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 23, 2011, 1:19 AM EDT
C# Corner56 reputationPosted Jun 30, 2011, 1:55 AM EDT