错误:表达式不会产生值

har*_*ang 4 c# vb.net

我试图将以下C#代码转换为VB.NET,并在编译代码时得到"Expression不会产生值"错误

C#代码

        return Fluently.Configure().Mappings(m => m.FluentMappings.AddFromAssemblyOf<MyEntityMapping>())
            .Database(SQLiteConfiguration.Standard.InMemory().ShowSql())
            .ExposeConfiguration(x => new SchemaExport(x).Execute(false, true, false))
            .BuildSessionFactory();
Run Code Online (Sandbox Code Playgroud)

VB.NET代码

    Return Fluently.Configure() _
        .Mappings(Function(m) m.FluentMappings.AddFromAssemblyOf(Of SubscriptionMap)()) _
        .Database(SQLiteConfiguration.Standard.InMemory().ShowSql()) _
        .ExposeConfiguration(Function(x) New SchemaExport(x).Execute(False, True, False)) _
        .BuildSessionFactory()
Run Code Online (Sandbox Code Playgroud)

错误发生在VB.NET代码的第二行,而C#代码编译没有问题.

转换有什么问题?

谢谢


SLa*_*aks 5

你需要创建一个Sub(x),而不是一个Function(x).