Skip to main content

CollectionViewModelBase(IUnitOfWorkFactory<TUnitOfWork>, Func<TUnitOfWork, IRepository<TEntity, TPrimaryKey>>, Func<IRepositoryQuery<TEntity>, IQueryable<TProjection>>, Action<TEntity>, Func<Boolean>, Boolean, UnitOfWorkPolicy) Constructor

Initializes a new instance of the CollectionViewModelBase<TEntity, TProjection, TPrimaryKey, TUnitOfWork> class with specified settings.

Namespace: DevExpress.Mvvm.ViewModel

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

Declaration

public CollectionViewModelBase(
    IUnitOfWorkFactory<TUnitOfWork> unitOfWorkFactory,
    Func<TUnitOfWork, IRepository<TEntity, TPrimaryKey>> getRepositoryFunc,
    Func<IRepositoryQuery<TEntity>, IQueryable<TProjection>> projection = null,
    Action<TEntity> newEntityInitializer = null,
    Func<bool> canCreateNewEntity = null,
    bool ignoreSelectEntityMessage = false,
    UnitOfWorkPolicy unitOfWorkPolicy = UnitOfWorkPolicy.Individual
)

Parameters

Name Type
unitOfWorkFactory IUnitOfWorkFactory<TUnitOfWork>
getRepositoryFunc Func<TUnitOfWork, IRepository<TEntity, TPrimaryKey>>

Optional Parameters

Name Type Default
projection Func<IRepositoryQuery<TEntity>, IQueryable<TProjection>> null
newEntityInitializer Action<TEntity> null
canCreateNewEntity Func<Boolean> null
ignoreSelectEntityMessage Boolean False
unitOfWorkPolicy DevExpress.Mvvm.ViewModel.UnitOfWorkPolicy Individual
See Also