I am doing a very simple stuff but not working. I have,
public class A : IA
{
}
public interface IA
{
}
public class B<T> where T : IA
{
}
Now I am using Autofac to register this,
builder.Register<B<IA>>(b =>
{
return new B<A>();
});
But I am getting this error,
Cannot implicitly convert type 'B<A>' to 'B<IA>'?
Cannot convert lambda expression to delegate type 'System.Func<Autofac.IComponentContext,B<IA>>' because some of the return types in the block are not implicitly convertible to the delegate return type