Csharp/C#教程:错误:表达式不生成值分享


错误:表达式不生成值

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

C#代码

return Fluently.Configure().Mappings(m => m.FluentMappings.AddFromAssemblyOf()) .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#学习教程:错误:表达式不生成值分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/955064.html

(0)
上一篇 2021年11月21日
下一篇 2021年11月21日

精彩推荐