我试图将以下 C# 代码转换为 VB.NET,但在编译代码时出现“表达式不产生值”错误
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();
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()
错误发生在 VB.NET 代码的倒数第二行,而 C# 代码编译没有问题。
转换有什么问题?
谢谢
最佳答案
您需要创建一个Sub(x)
,而不是Function(x)
。
关于c# - 错误 : Expression does not produce a value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8617657/