I have a function:
TResult ShowDialogWindow<TViewModel, TView, TResult>(Func<TViewModel> viewModelActivator,
Func<TViewModel, TView> viewActivator,
Func<TViewModel, TView, TResult> dialogResultFunc)
I would like to fake the return value of the function except the code returns an anonymous type like so:
_dialogService.ShowDialogWindow(() => new ViewModel(),
viewModel => new View(viewModel),
(viewModel, view) => new { view.DialogResult, view.SomeOtherInfo });
I have looked at some pre-existing answers and discussions but they deal with matching parameters rather than return type:
Any suggestions?
P.S. My current workaround is to just avoid returning anonymous types.