У меня есть выражение og MOQ (лямбда / linq) в c #. Когда я пытаюсь использовать этот код в vb.net, я получаю сообщение об ошибке
код C #
_dataLayerMock.Setup(x => x.SaveAccount(It.Is<Account>(a => a.AccountType == AccountType.Private)));
Преобразованный код VB.net
_dataLayerMock.Setup(Function(x) x.SaveAccount(It.[Is](Of Account)(Function(a) a.AccountType = AccountType.[Private])))
Error
Error 1 Overload resolution failed because no accessible 'Setup' can be called with these arguments:
'Public Function Setup(Of TResult)(expression As System.Linq.Expressions.Expression(Of System.Func(Of ConsoleApplication1.IDataLayer, TResult))) As Moq.Language.Flow.ISetup(Of ConsoleApplication1.IDataLayer, TResult)': Expression does not produce a value.
'Public Function Setup(Of TResult)(expression As System.Linq.Expressions.Expression(Of System.Func(Of ConsoleApplication1.IDataLayer, TResult))) As Moq.Language.Flow.ISetup(Of ConsoleApplication1.IDataLayer, TResult)': Data type(s) of the type parameter(s) cannot be inferred from these arguments. Specifying the data type(s) explicitly might correct this error.
'Public Function Setup(expression As System.Linq.Expressions.Expression(Of System.Action(Of ConsoleApplication1.IDataLayer))) As Moq.Language.Flow.ISetup(Of ConsoleApplication1.IDataLayer)': Expression does not produce a value. D:\Araamudhan\Project\Amex\Maven-NPanday\Application\ClassLibrary\LinqTest\LinqTest\BusinessLayerTest.vb 20 9 LinqTest
Может ли кто-нибудь помочь мне решить эту проблему