✅ Can't have interface with abstract static method as parameter in blazor component
I have interface and class like this:
interface IFoo{ static abstract IFoo Create(); void SomeFunction();}class Foo : IFoo{ public static IFoo Create() => new Foo(); public void SomeFunction() { }}
interface IFoo{ static abstract IFoo Create(); void SomeFunction();}class Foo : IFoo{ public static IFoo Create() => new Foo(); public void SomeFunction() { }}
now i want to have
IFoo
IFoo
as parameter in blazor component like this:
[Parameter]public IFoo MyFoo { get; set; }
[Parameter]public IFoo MyFoo { get; set; }
but when i try to pass instance of Foo into the component i get this error:
CS8920 The interface 'IFoo' cannot be used as type argument. Static member 'IFoo.Create()' does not have a most specific implementation in the interface.
CS8920 The interface 'IFoo' cannot be used as type argument. Static member 'IFoo.Create()' does not have a most specific implementation in the interface.