I have a generic interface which inherits from another generic interface from a third party library (which makes it impossible to use covariance and contravariance) .
Here is my code
public interface IFABaseAppService<TDto, TKey>
: ICrudAppService<TDto, TKey> where TDto : FABaseDto
{
}
I have another interface IUserAppService
public interface IUserAppService : IFABaseAppService<UserDto, Guid>
{
}
Then I have a base class which accepts IFABaseAppService<FABaseDto, Guid> in constructor as a parameter
public class FABaseStandardFormViewModel : FABaseViewModel
{
public FABaseStandardFormViewModel(IFABaseAppService<FABaseDto, Guid> appService) : base(appService)
{
}
}
Then I have created a class which accepts IUserAppService in the constructor and passes it to the base class, but it is giving me the following error:
cannot convert from 'FinancialsAce.ApplicationServices.Common.IUserAppService' to 'FinancialsAce.ApplicationServices.IFABaseAppService<FinancialsAce.DataTransferObjects.FABaseDto, System.Guid>