Error: expression does not give value

I tried to convert the following C # code to VB.NET and got the error “Expression does not cause value” when compiling the code

C # code

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 Code

  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() 

The error occurs on the second last line of VB.NET code, and the C # code compiled without problems.

What is wrong with the conversion?

thanks


+4
source share
1 answer

You need to create Sub(x) , not Function(x) .

+5
source

Source: https://habr.com/ru/post/1387756/


All Articles