Is there any reason to not have an overload with the data parameter for CreateView?
With the current signature:
ISynchronizedView<T, TView> CreateView<TView>(Func<T, TView> transform);
viewFactory is captured:
_synchronizedView = myModel.Items
.CreateView(item => {
return viewFactory.Create(item);
});
While this way
ISynchronizedView<T, TView> CreateView<TData, TView>(TData data, Func<T, TData, TView> transform);
it isn't, and the lambda can be made static:
_synchronizedView = myModel.Items
.CreateView(viewFactory, static (item, viewFactory) => {
return viewFactory.Create(item);
});
Is there any reason to not have an overload with the data parameter for
CreateView?With the current signature:
ISynchronizedView<T, TView> CreateView<TView>(Func<T, TView> transform);viewFactoryis captured:While this way
ISynchronizedView<T, TView> CreateView<TData, TView>(TData data, Func<T, TData, TView> transform);it isn't, and the lambda can be made static: