Skip to content

Data parameter in CreateView #117

Description

@vklubkov

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);
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions