Repository<TEntity> Class
Assembly: PTS.DomainFramework.Infrastructure.dll
Syntax
public class Repository<TEntity> : Repository, IRepository<TEntity>, IQueryable<TEntity>, IEnumerable<TEntity>, IRepository, IQueryable, IEnumerable, IAsyncEnumerable<TEntity> where TEntity : class
Type Parameters
Inheritance
System.Object
Repository<TEntity>
Implements
System.Linq.IQueryable<TEntity>
System.Collections.Generic.IEnumerable<TEntity>
System.Linq.IQueryable
System.Collections.IEnumerable
System.Collections.Generic.IAsyncEnumerable<TEntity>
Constructors
Repository()
Declaration
Repository(DbContext)
Declaration
public Repository(DbContext dbContext)
Parameters
Type |
Name |
Description |
Microsoft.EntityFrameworkCore.DbContext |
dbContext |
|
Repository(DbContext, ITriggerHandler<TEntity>)
Declaration
public Repository(DbContext dbContext, ITriggerHandler<TEntity> eventService)
Parameters
Type |
Name |
Description |
Microsoft.EntityFrameworkCore.DbContext |
dbContext |
|
ITriggerHandler<TEntity> |
eventService |
|
Properties
DbSet
Declaration
protected DbSet<TEntity> DbSet { get; }
Property Value
Type |
Description |
Microsoft.EntityFrameworkCore.DbSet<TEntity> |
|
Events
Declaration
protected ITriggerHandler<TEntity> Events { get; }
Property Value
Source
Declaration
protected override IQueryable Source { get; }
Property Value
Type |
Description |
System.Linq.IQueryable |
|
Overrides
Methods
Add(TEntity)
Declaration
public void Add(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Add(TEntity, Object)
Declaration
public void Add(TEntity entity, object sender)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Object |
sender |
|
AddAsync(TEntity, Object, CancellationToken)
Declaration
public Task AddAsync(TEntity entity, object sender, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Object |
sender |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
AddAsync(TEntity, CancellationToken)
Declaration
public Task AddAsync(TEntity entity, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
AddRange(TEntity[])
Declaration
public void AddRange(params TEntity[] entities)
Parameters
Type |
Name |
Description |
TEntity[] |
entities |
|
AddRange(IEnumerable<TEntity>)
Declaration
public void AddRange(IEnumerable<TEntity> entities)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
AddRange(IEnumerable<TEntity>, Object)
Declaration
public void AddRange(IEnumerable<TEntity> entities, object sender)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Object |
sender |
|
AddRangeAsync(TEntity[])
Declaration
public Task AddRangeAsync(params TEntity[] entities)
Parameters
Type |
Name |
Description |
TEntity[] |
entities |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
AddRangeAsync(IEnumerable<TEntity>, Object, CancellationToken)
Declaration
public Task AddRangeAsync(IEnumerable<TEntity> entities, object sender, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Object |
sender |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
AddRangeAsync(IEnumerable<TEntity>, CancellationToken)
Declaration
public Task AddRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Attach(TEntity)
Declaration
public void Attach(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Attach(TEntity, Object)
Declaration
public void Attach(TEntity entity, object sender)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Object |
sender |
|
AttachRange(TEntity[])
Declaration
public void AttachRange(params TEntity[] entities)
Parameters
Type |
Name |
Description |
TEntity[] |
entities |
|
AttachRange(IEnumerable<TEntity>)
Declaration
public void AttachRange(IEnumerable<TEntity> entities)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
AttachRange(IEnumerable<TEntity>, Object)
Declaration
public void AttachRange(IEnumerable<TEntity> entities, object sender)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Object |
sender |
|
Find(Object[])
Declaration
public TEntity Find(params object[] keyValues)
Parameters
Type |
Name |
Description |
System.Object[] |
keyValues |
|
Returns
FindAsync(Object[])
Declaration
public ValueTask<TEntity> FindAsync(params object[] keyValues)
Parameters
Type |
Name |
Description |
System.Object[] |
keyValues |
|
Returns
Type |
Description |
System.Threading.Tasks.ValueTask<TEntity> |
|
FindAsync(Object[], CancellationToken)
Declaration
public ValueTask<TEntity> FindAsync(object[] keyValues, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.Object[] |
keyValues |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.ValueTask<TEntity> |
|
GetAsyncEnumerator(CancellationToken)
Declaration
public IAsyncEnumerator<TEntity> GetAsyncEnumerator(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Collections.Generic.IAsyncEnumerator<TEntity> |
|
GetEnumerator()
Declaration
public IEnumerator<TEntity> GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<TEntity> |
|
Remove(TEntity)
Declaration
public void Remove(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Remove(TEntity, Object)
Declaration
public void Remove(TEntity entity, object sender)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Object |
sender |
|
RemoveRange(TEntity[])
Declaration
public void RemoveRange(params TEntity[] entities)
Parameters
Type |
Name |
Description |
TEntity[] |
entities |
|
RemoveRange(IEnumerable<TEntity>)
Declaration
public void RemoveRange(IEnumerable<TEntity> entities)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
RemoveRange(IEnumerable<TEntity>, Object)
Declaration
public void RemoveRange(IEnumerable<TEntity> entities, object sender)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Object |
sender |
|
TryAdd(TEntity)
Declaration
public bool TryAdd(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Returns
Type |
Description |
System.Boolean |
|
TryAdd(TEntity, Object)
Declaration
public bool TryAdd(TEntity entity, object sender)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Object |
sender |
|
Returns
Type |
Description |
System.Boolean |
|
TryAddAsync(TEntity, Object, CancellationToken)
Declaration
public Task<bool> TryAddAsync(TEntity entity, object sender, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Object |
sender |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
TryAddAsync(TEntity, CancellationToken)
Declaration
public Task<bool> TryAddAsync(TEntity entity, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
TryAddRange(TEntity[])
Declaration
public void TryAddRange(params TEntity[] entities)
Parameters
Type |
Name |
Description |
TEntity[] |
entities |
|
TryAddRange(IEnumerable<TEntity>)
Declaration
public void TryAddRange(IEnumerable<TEntity> entities)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
TryAddRange(IEnumerable<TEntity>, Object)
Declaration
public void TryAddRange(IEnumerable<TEntity> entities, object sender)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Object |
sender |
|
TryAddRangeAsync(TEntity[])
Declaration
public Task TryAddRangeAsync(params TEntity[] entities)
Parameters
Type |
Name |
Description |
TEntity[] |
entities |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
TryAddRangeAsync(IEnumerable<TEntity>, Object, CancellationToken)
Declaration
public Task TryAddRangeAsync(IEnumerable<TEntity> entities, object sender, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Object |
sender |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
TryAddRangeAsync(IEnumerable<TEntity>, CancellationToken)
Declaration
public Task TryAddRangeAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Update(TEntity)
Declaration
public void Update(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Update(TEntity, Object)
Declaration
public void Update(TEntity entity, object sender)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Object |
sender |
|
UpdateRange(TEntity[])
Declaration
public void UpdateRange(params TEntity[] entities)
Parameters
Type |
Name |
Description |
TEntity[] |
entities |
|
UpdateRange(IEnumerable<TEntity>)
Declaration
public void UpdateRange(IEnumerable<TEntity> entities)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
UpdateRange(IEnumerable<TEntity>, Object)
Declaration
public void UpdateRange(IEnumerable<TEntity> entities, object sender)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TEntity> |
entities |
|
System.Object |
sender |
|
Implements
System.Linq.IQueryable<T>
System.Collections.Generic.IEnumerable<T>
System.Linq.IQueryable
System.Collections.IEnumerable
System.Collections.Generic.IAsyncEnumerable<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Extension Methods