/// <inheritdoc /> public async Task <IEnumerable <TEntity> > ReadAsync(IEnumerable <TId> ids, CancellationToken ct) { if (ids == null) { throw new ArgumentNullException(nameof(ids)); } return(await _container.Query <TEntity>().Where(e => ids.Contains(e.Id)).ToListAsync(ct)); }
/// <summary> /// Creates a new instance /// </summary> /// <param name="container"></param> public EFCoreQueryable( EFCoreContextContainer container ) { if (container == null) { throw new ArgumentNullException(nameof(container)); } _query = container.Query <TEntity>(); }
/// <inheritdoc /> public async Task <TEntity> ReadAsync(TId externalId, CancellationToken ct) => await _container.Query <TEntity>().SingleOrDefaultAsync(e => e.ExternalId.Equals(externalId), ct);
/// <inheritdoc /> public async Task <bool> ExistsAsync(TId id, CancellationToken ct) => await _container.Query <TEntity>().AnyAsync(e => e.Id.Equals(id), ct);