Skip to main content

PeekCollectionViewModel<TNavigationToken, TEntity, TPrimaryKey, TUnitOfWork>.Create(TNavigationToken, IUnitOfWorkFactory<TUnitOfWork>, Func<TUnitOfWork, IRepository<TEntity, TPrimaryKey>>, Func<IRepositoryQuery<TEntity>, IQueryable<TEntity>>) Method

Creates a new instance of PeekCollectionViewModel as a POCO view model.

Namespace: DevExpress.Mvvm.ViewModel

Assembly: DevExpress.Mvvm.v24.2.ViewModel.dll

Declaration

public static PeekCollectionViewModel<TNavigationToken, TEntity, TPrimaryKey, TUnitOfWork> Create(
    TNavigationToken navigationToken,
    IUnitOfWorkFactory<TUnitOfWork> unitOfWorkFactory,
    Func<TUnitOfWork, IRepository<TEntity, TPrimaryKey>> getRepositoryFunc,
    Func<IRepositoryQuery<TEntity>, IQueryable<TEntity>> projection = null
)

Parameters

Name Type Description
navigationToken TNavigationToken

Identifies the module that is the navigation target.

unitOfWorkFactory IUnitOfWorkFactory<TUnitOfWork>

A factory that is used to create a unit of work instance.

getRepositoryFunc Func<TUnitOfWork, IRepository<TEntity, TPrimaryKey>>

A function that returns a repository representing entities of a given type.

Optional Parameters

Name Type Default Description
projection Func<IRepositoryQuery<TEntity>, IQueryable<TEntity>> null

An optional parameter that provides a LINQ function used to customize a query for entities. The parameter, for example, can be used for sorting data.

Returns

Type
PeekCollectionViewModel<TNavigationToken, TEntity, TPrimaryKey, TUnitOfWork>
See Also