调用从 F# 获取 Action<A> 或 Action<A,B> 的重载 C# 方法
Calling an overloaded C# method that takes an Action<A> or a Action<A,B> from F#
这是两个重载的签名。
public static IServiceCollection AddDbContextPool<TContext>(
this IServiceCollection serviceCollection,
Action<DbContextOptionsBuilder> optionsAction,
int poolSize = 128) where TContext : DbContext { ...
public static IServiceCollection AddDbContextPool<TContext>(
this IServiceCollection serviceCollection,
Action<IServiceProvider, DbContextOptionsBuilder> optionsAction,
int poolSize = 128)
where TContext : DbContext { ...
这是在 C# 中调用的第二个重载
但是,当我尝试从 F# 调用第二个重载时,出现此错误:
我该如何解决这个问题?谢谢!
尝试通过:
fun (sp: IServiceProvider) (optionsBuilder: ...) -> ...
这是两个重载的签名。
public static IServiceCollection AddDbContextPool<TContext>(
this IServiceCollection serviceCollection,
Action<DbContextOptionsBuilder> optionsAction,
int poolSize = 128) where TContext : DbContext { ...
public static IServiceCollection AddDbContextPool<TContext>(
this IServiceCollection serviceCollection,
Action<IServiceProvider, DbContextOptionsBuilder> optionsAction,
int poolSize = 128)
where TContext : DbContext { ...
这是在 C# 中调用的第二个重载
但是,当我尝试从 F# 调用第二个重载时,出现此错误:
我该如何解决这个问题?谢谢!
尝试通过:
fun (sp: IServiceProvider) (optionsBuilder: ...) -> ...