使用 F# 配置 EF Core

sev*_*rin 2 f# entity-framework asp.net-core

我正在尝试使用 F# 设置 EF Core。我的 DbContext 看起来像这样

type MainContext(options : DbContextOptions<MainContext>) =
    inherit DbContext(options)

    [<DefaultValue()>] val mutable dokumenter : DbSet<Dokument>
    member x.Dokumenter with get() = x.dokumenter and set v = x.dokumenter <- v
Run Code Online (Sandbox Code Playgroud)

在 Startup.fs 中:

   member this.ConfigureServices(services: IServiceCollection) =
        services.AddDbContext<MainContext>(fun options -> options.UseInMemoryDatabase()) |> ignore
Run Code Online (Sandbox Code Playgroud)

这给出了以下编译错误:

No overloads match for method 'AddDbContext'. The available overloads are shown below (or in the Error List window).

我究竟做错了什么?

sev*_*rin 5

添加|>忽略后UseInMemoryDatabase()做的伎俩:

services.AddDbContext<MainContext>(fun options -> options.UseInMemoryDatabase() |> ignore) |> ignore
Run Code Online (Sandbox Code Playgroud)