【发布时间】:2020-02-18 22:25:03
【问题描述】:
这是两个重载的签名。
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 { ...
但是当我尝试从 F# 调用第二个重载时,我得到了这个错误:
我该如何解决这个问题?谢谢!
【问题讨论】:
-
尝试传递
fun (sp: IServiceProvider) (optionsBuilder: ...) -> ... -
@AMieres Ulgh,就是这样。复制粘贴到答案,我会接受 =)
标签: f# overloading c#-to-f#