|
|
|
@ -192,7 +192,7 @@ public class MemoryDbRepository<TMemoryDbContext, TEntity> : RepositoryBase<TEnt |
|
|
|
TriggerDomainEvents(entity); |
|
|
|
} |
|
|
|
|
|
|
|
public override async Task<TEntity> FindAsync( |
|
|
|
public override async Task<TEntity?> FindAsync( |
|
|
|
Expression<Func<TEntity, bool>> predicate, |
|
|
|
bool includeDetails = true, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
@ -340,14 +340,14 @@ public class MemoryDbRepository<TMemoryDbContext, TEntity, TKey> : MemoryDbRepos |
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<TEntity> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) |
|
|
|
public virtual async Task<TEntity?> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return (await GetQueryableAsync()).FirstOrDefault(e => e.Id.Equals(id)); |
|
|
|
return (await GetQueryableAsync()).FirstOrDefault(e => e.Id!.Equals(id)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
await DeleteAsync(x => x.Id.Equals(id), autoSave, cancellationToken); |
|
|
|
await DeleteAsync(x => x.Id!.Equals(id), autoSave, cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task DeleteManyAsync(IEnumerable<TKey> ids, bool autoSave = false, CancellationToken cancellationToken = default) |
|
|
|
|