Database.Setup(x => x.Update(It.IsAny<Subscription>())) .Callback<object>(sub => SavedSubscription = sub as Subscription);
This line works with PetaPoco. Because of project requirements, had to switch to Dapper (and also had to add DapperExtensions in order to have CRUD methods) so now I am getting this error:
An expression tree may not contain a call or invocation that uses optional arguments
Any ideas how to handle this?
Note that this is a limitation inherent to the framework and not Moq; you can't pass a method with a default parameter to an
Expression. Jon Skeet gives a good demonstration why here.