0

enter image description here

Refer to the image above, we can see the AbpAsyncDeterminiationInterceptor must have a generic type which is the same as what is provided into its constructor. Supposed it should be interpreted automatically instead of explicitly specifies something like new AbpAsyncDeterminiationInterceptor<BlueprintInterceptor>(new BlueprintInterceptor());

The weird point is that, sometimes when I call a function, I won't need to specify the generic type and the function could reveal the return type from the parameter type.

Thanks in advance.

jared-dev
  • 103
  • 13
mannok
  • 1,712
  • 1
  • 20
  • 30
  • 4
    See [why can't the C# constructor infer type?](https://stackoverflow.com/questions/3570167/why-cant-the-c-sharp-constructor-infer-type). – Guru Stron Jun 30 '22 at 05:01
  • In general C# compiler can infer type only in "simple" scenarios - if method is generic and has parameters for every generic parameter (and the class itself is not generic). – Guru Stron Jun 30 '22 at 05:13

0 Answers0