Hi Ashman786,
In General it is a bad idea to implement Services without Interfaces, cause the Interface represents the Service contract. Anyway I don't see any reason why you can't do "both".
Look at this example code "structure".
You can work with inheritance - also with Interfaces.
So you have:
a Interface for common Service operations like this:
[ServiceContract]
public interface ICommonServiceMethods
{
[OperationContract]
string WriteLog(string strMessage);
}
a specific Service Interface inherited from the common operations Interface like this:
[ServiceContract]
public interface IService1 : ICommonServiceMethods
{
[OperationContract]
string GetData(int value);
}
You can implement your common Service operations in a base class (could be abstract)
public class BaseService : ICommonServiceMethods
{
public string WriteLog(string strMessage)
{
return strMessage;
}
}
And then just derive your specific Service instance from the base class while implementing the specific Service.
public class Service1 : BaseService, IService1
{
public string GetData(int value) { return value.ToString(); }
}
So no need to think about omitting "Interfaces" - although technically you could...
I hope this helps?
Kind regards Johannes