Hi,
i am new here and thats my first entry in this forum, i hope somebody can help me with this hopefully easy question? I am trying to implement a base WCF Service from which my sub services should inherit.
My Base Service looks like this:
Class: BaseService.cs
[ServiceContract]
public class BaseService
{
[OperationContract]
public DateTime GetDate()
{
return DateTime.Now;
}
}
Here is my sub Service whicht should inherit all Methods from BaseService.
[ServiceContract]
public class TestService:BaseService
{
[OperationContract]
public string SayHello()
{
return "Hello";
}
}
When i try to host my TestService with ServiceHost like this:
ServiceHost _host;
_host = new ServiceHost(typeof(TestService.TestService));
_host.Open();
i get an exception that says something like: the service inheritance can only
be between interface types.
So here is my question: Is there a possiblity to inherit from a Base Service Class
to provide base functionality like getdate() or something like this, or is this absolutly impossible.
Best Regards
Manuel