Skip to main content

RepositoryExtensions.FindActualProjectionByKey<TEntity, TProjection, TPrimaryKey>(IRepository<TEntity, TPrimaryKey>, Func<IRepositoryQuery<TEntity>, IQueryable<TProjection>>, TPrimaryKey) Method

Loads from the store or updates an entity with the given primary key value. If no entity with the given primary key is found in the store, returns null.

Namespace: DevExpress.Mvvm.DataModel

Assembly: DevExpress.Mvvm.v24.1.DataModel.dll

NuGet Package: DevExpress.Scaffolding.Core

Declaration

public static TProjection FindActualProjectionByKey<TEntity, TProjection, TPrimaryKey>(
    this IRepository<TEntity, TPrimaryKey> repository,
    Func<IRepositoryQuery<TEntity>, IQueryable<TProjection>> projection,
    TPrimaryKey primaryKey
)
    where TEntity : class

Parameters

Name Type Description
repository IRepository<TEntity, TPrimaryKey>

A repository.

projection Func<IRepositoryQuery<TEntity>, IQueryable<TProjection>>

A LINQ function used to transform entities from the repository entity type to the projection entity type.

primaryKey TPrimaryKey

A value to compare with the entity primary key.

Type Parameters

Name
TEntity
TProjection
TPrimaryKey

Returns

Type Description
TProjection

The entity with the given primary key value. null if no entity is found.

See Also