예제 #1
0
        /// <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));
        }
예제 #2
0
 /// <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>();
 }
예제 #3
0
 /// <inheritdoc />
 public async Task <TEntity> ReadAsync(TId externalId, CancellationToken ct) =>
 await _container.Query <TEntity>().SingleOrDefaultAsync(e => e.ExternalId.Equals(externalId), ct);
예제 #4
0
 /// <inheritdoc />
 public async Task <bool> ExistsAsync(TId id, CancellationToken ct) =>
 await _container.Query <TEntity>().AnyAsync(e => e.Id.Equals(id), ct);