There is an interface which inherits the generic interface.
Here is generic interface
public interface IBaseService<TEntity> where TEntity : BaseEntity
{
}
Interface which inherits generic interface
public interface IChatService :IBaseService<Messages>
{
}
Then i have a class which takes the generic interface in the constructor as a parameter.
public class BaseApi
{
IBaseService<BaseEntity> _baseService;
public BaseApi(IBaseService<BaseEntity> baseService)
{
_baseService = baseService;
}
}
When i pass the interface object which implements the generic interface it doesn't allow me to pass the object of the interface, it asks to pass generic interface.
Here is error:
Any solution?
Thanks in advance, sorry for bad english!