I have an issue, hope someone can help me a bit. I have the following interface :
public interface ITaskService
{
ITaskBase GetTask(IRequestBase request);
}
i want to implement the method something like this :
public ITaskBase GetTask(Request request)
{
}
Where the request is a model that looks like this :
public class Request:IRequestBase
{
public DateTime CheckIn { get; set; }
public DateTime CheckOut { get; set; }
}
I'm getting a compilation error that says the class does not implement the interface ITaskService , but I don't get it why the request parameter is inherited from the IRequestBase interface
Make ITaskService generic.
public interface ITaskService<T> where T : IRequestBase
{
ITaskBase GetTask(T request);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With