< Summary - ZhEaIsNsAaBn.Libraries coverage (affected: 23 packages)

Information
Class: ZhEaIsNsAaBn.Infrastructure.Core.BaseRepository<T1, T2, T3>
Assembly: ZhEaIsNsAaBn.Infrastructure.Core
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Core/Repositories/BaseRepository.cs
Line coverage
42%
Covered lines: 37
Uncovered lines: 51
Coverable lines: 88
Total lines: 382
Line coverage: 42%
Branch coverage
32%
Covered branches: 15
Total branches: 46
Branch coverage: 32.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Add(...)0%620%
AddAndSave(...)50%44100%
AddAndSaveAsync()75%44100%
AddAsync()0%620%
AddRange(...)0%620%
AddRangeAndSave(...)0%620%
AddRangeAndSaveAsync()100%22100%
Delete(...)0%620%
DeleteAndSave(...)50%22100%
DeleteAndSaveAsync()0%620%
DeleteRange(...)0%620%
GetDbContext(...)100%11100%
GetDbContextAsync(...)100%11100%
GetPaged(...)100%210%
GetPagedAsync()100%210%
GetQueryable(...)100%11100%
GetQueryableAsync()100%210%
GetTracking(...)50%44100%
GetTrackingAsync()75%44100%
SaveChanges(...)100%11100%
SaveChangesAsync(...)100%11100%
Update(...)0%620%
UpdateAndSave(...)50%22100%
UpdateAndSaveAsync()0%620%
UpdateRange(...)0%620%
UpdateRangeAndSave(...)50%22100%
UpdateRangeAndSaveAsync()0%620%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Core/Repositories/BaseRepository.cs

#LineLine coverage
 1namespace ZhEaIsNsAaBn.Infrastructure.Core;
 2
 3/// <summary><see cref="BaseRepository{TDbContext, TEntity, TId}"/> for <see cref="int"/>-keyed entities.</summary>
 4/// <typeparam name="TDbContext">The application's context.</typeparam>
 5/// <typeparam name="TEntity">The entity type.</typeparam>
 6public abstract class BaseRepository< TDbContext, TEntity > : BaseRepository<TDbContext, TEntity, int>
 7    where TEntity : class, IBaseEntity
 8    where TDbContext : DbContext
 9{
 10    /// <inheritdoc />
 11    protected BaseRepository( IDbContextProvider<TDbContext> dbContextProvider ) : base( dbContextProvider ) { }
 12}
 13
 14/// <summary>
 15/// Base for repositories: protected write helpers (single-shot <c>*AndSave</c> methods return <see cref="LayerResponse{
 16/// and paging. Every helper uses the provider's shared context unless a <c>dbContext</c> is passed.
 17/// </summary>
 18/// <remarks>
 19/// A <see cref="DbContext"/> is not thread-safe. For parallel work, give each task its own context
 20/// (<c>GetDbContextAsync( singleInstance: false )</c>), pass it as <c>dbContext</c>, and dispose it when the task ends.
 21/// </remarks>
 22/// <typeparam name="TDbContext">The application's context.</typeparam>
 23/// <typeparam name="TEntity">The entity type.</typeparam>
 24/// <typeparam name="TId">The key type.</typeparam>
 25public abstract class BaseRepository< TDbContext, TEntity, TId >
 26    where TEntity : class, IBaseEntity<TId>
 27    where TDbContext : DbContext
 28    where TId : struct, IEquatable<TId>
 29{
 30    /// <summary>Creates the repository.</summary>
 31    /// <param name="dbContextProvider">The context provider.</param>
 32    /// <exception cref="ArgumentNullException"><paramref name="dbContextProvider"/> is <see langword="null"/>.</excepti
 23633    protected BaseRepository( IDbContextProvider<TDbContext> dbContextProvider )
 34    {
 23635        ArgumentNullException.ThrowIfNull( dbContextProvider );
 36
 23637        DbContextProvider = dbContextProvider;
 23638    }
 39
 40
 41    /// <summary>The context provider.</summary>
 42    protected IDbContextProvider<TDbContext> DbContextProvider { get; }
 43
 44
 45    /// <summary>Marks <paramref name="entity"/> as added. Nothing is saved.</summary>
 46    /// <param name="entity">The entity.</param>
 47    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 48    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 49    protected virtual void Add( TEntity entity, TDbContext? dbContext = null, CancellationToken cancellationToken = defa
 050        => ( dbContext ?? GetDbContext( cancellationToken ) ).Set<TEntity>().Add( entity );
 51
 52    /// <summary>Adds <paramref name="entity"/> and saves.</summary>
 53    /// <param name="entity">The entity.</param>
 54    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 55    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 56    /// <returns>The new key, or the classified database error.</returns>
 57    protected virtual LayerResponse<TId> AddAndSave( TEntity entity, TDbContext? dbContext = null, CancellationToken can
 58    {
 459        dbContext ??= GetDbContext( cancellationToken );
 460        dbContext.Set<TEntity>().Add( entity );
 61
 62
 463        var saved = SaveChanges( dbContext );
 64
 65
 466        return saved.IsSuccess ? entity.Id : saved.Errors;
 67    }
 68
 69    /// <summary>Async version of <see cref="AddAndSave"/>.</summary>
 70    /// <param name="entity">The entity.</param>
 71    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 72    /// <param name="cancellationToken">Token to cancel the operation.</param>
 73    /// <returns>The new key, or the classified database error.</returns>
 74    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 75    protected virtual async ValueTask<LayerResponse<TId>> AddAndSaveAsync( TEntity entity, TDbContext? dbContext = null,
 76    {
 1277        dbContext ??= await GetDbContextAsync( cancellationToken ).ConfigureAwait( false );
 1278        await dbContext.Set<TEntity>().AddAsync( entity, cancellationToken ).ConfigureAwait( false );
 79
 80
 1281        var saved = await SaveChangesAsync( dbContext, cancellationToken ).ConfigureAwait( false );
 82
 83
 1284        return saved.IsSuccess ? entity.Id : saved.Errors;
 1285    }
 86
 87    /// <summary>Marks <paramref name="entity"/> as added, letting async value generators run. Nothing is saved.</summar
 88    /// <param name="entity">The entity.</param>
 89    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 90    /// <param name="cancellationToken">Token to cancel the operation.</param>
 91    /// <returns>The entity's change-tracking entry.</returns>
 92    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 93    protected virtual async ValueTask<EntityEntry<TEntity>> AddAsync( TEntity entity, TDbContext? dbContext = null, Canc
 94    {
 095        dbContext ??= await GetDbContextAsync( cancellationToken ).ConfigureAwait( false );
 96
 97
 098        return await dbContext.Set<TEntity>().AddAsync( entity, cancellationToken ).ConfigureAwait( false );
 099    }
 100
 101    /// <summary>Marks <paramref name="entities"/> as added. Nothing is saved.</summary>
 102    /// <param name="entities">The entities.</param>
 103    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 104    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 105    protected virtual void AddRange( IEnumerable<TEntity> entities, TDbContext? dbContext = null, CancellationToken canc
 0106        => ( dbContext ?? GetDbContext( cancellationToken ) ).Set<TEntity>().AddRange( entities );
 107
 108    /// <summary>Adds <paramref name="entities"/> and saves.</summary>
 109    /// <param name="entities">The entities.</param>
 110    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 111    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 112    /// <returns>The number of rows written, or the classified database error.</returns>
 113    protected virtual LayerResponse<int> AddRangeAndSave( IEnumerable<TEntity> entities, TDbContext? dbContext = null, C
 114    {
 0115        dbContext ??= GetDbContext( cancellationToken );
 0116        dbContext.Set<TEntity>().AddRange( entities );
 117
 118
 0119        return SaveChanges( dbContext );
 120    }
 121
 122    /// <summary>Async version of <see cref="AddRangeAndSave"/>.</summary>
 123    /// <param name="entities">The entities.</param>
 124    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 125    /// <param name="cancellationToken">Token to cancel the operation.</param>
 126    /// <returns>The number of rows written, or the classified database error.</returns>
 127    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 128    protected virtual async Task<LayerResponse<int>> AddRangeAndSaveAsync( IEnumerable<TEntity> entities, TDbContext? db
 129    {
 4130        dbContext ??= await GetDbContextAsync( cancellationToken ).ConfigureAwait( false );
 4131        dbContext.Set<TEntity>().AddRange( entities );
 132
 133
 4134        return await SaveChangesAsync( dbContext, cancellationToken ).ConfigureAwait( false );
 4135    }
 136
 137    /// <summary>Marks <paramref name="entity"/> as deleted. Nothing is saved.</summary>
 138    /// <param name="entity">The entity.</param>
 139    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 140    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 141    protected virtual void Delete( TEntity entity, TDbContext? dbContext = null, CancellationToken cancellationToken = d
 0142        => ( dbContext ?? GetDbContext( cancellationToken ) ).Set<TEntity>().Remove( entity );
 143
 144    /// <summary>Deletes <paramref name="entity"/> and saves.</summary>
 145    /// <param name="entity">The entity.</param>
 146    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 147    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 148    /// <returns>The number of rows written, or the classified database error.</returns>
 149    protected virtual LayerResponse<int> DeleteAndSave( TEntity entity, TDbContext? dbContext = null, CancellationToken 
 150    {
 4151        dbContext ??= GetDbContext( cancellationToken );
 4152        dbContext.Set<TEntity>().Remove( entity );
 153
 154
 4155        return SaveChanges( dbContext );
 156    }
 157
 158    /// <summary>Async version of <see cref="DeleteAndSave"/>.</summary>
 159    /// <param name="entity">The entity.</param>
 160    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 161    /// <param name="cancellationToken">Token to cancel the operation.</param>
 162    /// <returns>The number of rows written, or the classified database error.</returns>
 163    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 164    protected virtual async Task<LayerResponse<int>> DeleteAndSaveAsync( TEntity entity, TDbContext? dbContext = null, C
 165    {
 0166        dbContext ??= await GetDbContextAsync( cancellationToken ).ConfigureAwait( false );
 0167        dbContext.Set<TEntity>().Remove( entity );
 168
 169
 0170        return await SaveChangesAsync( dbContext, cancellationToken ).ConfigureAwait( false );
 0171    }
 172
 173    /// <summary>Marks <paramref name="entities"/> as deleted. Nothing is saved.</summary>
 174    /// <param name="entities">The entities.</param>
 175    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 176    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 177    protected virtual void DeleteRange( IEnumerable<TEntity> entities, TDbContext? dbContext = null, CancellationToken c
 0178        => ( dbContext ?? GetDbContext( cancellationToken ) ).Set<TEntity>().RemoveRange( entities );
 179
 180    /// <summary>Returns the shared context.</summary>
 181    /// <param name="cancellationToken">Token to cancel waiting for the provider.</param>
 182    /// <returns>The shared context.</returns>
 248183    protected virtual TDbContext GetDbContext( CancellationToken cancellationToken = default ) => DbContextProvider.GetD
 184
 185    /// <summary>Async version of <see cref="GetDbContext"/>.</summary>
 186    /// <param name="cancellationToken">Token to cancel the operation.</param>
 187    /// <returns>The shared context.</returns>
 176188    protected virtual Task<TDbContext> GetDbContextAsync( CancellationToken cancellationToken = default ) => DbContextPr
 189
 190    /// <summary>Returns a page of <paramref name="query"/>, read without tracking.</summary>
 191    /// <param name="query">The query, already filtered and ordered.</param>
 192    /// <param name="page">1-based page number; values below 1 read page 1.</param>
 193    /// <param name="pageSize">Rows per page.</param>
 194    /// <returns>The page.</returns>
 195    /// <exception cref="ArgumentOutOfRangeException"><paramref name="pageSize"/> is not positive.</exception>
 196    protected PagedResult<TEntity> GetPaged( IQueryable<TEntity> query, int page, int pageSize )
 197    {
 0198        ArgumentOutOfRangeException.ThrowIfNegativeOrZero( pageSize );
 199
 0200        page  = Math.Max( page, 1 );
 0201        query = query.AsNoTracking();
 202
 203
 0204        var count = query.Count();
 205
 206
 0207        return new PagedResult<TEntity>
 0208                   {
 0209                       PageNumber = page,
 0210                       PageSize   = pageSize,
 0211                       TotalCount = count,
 0212                       TotalPages = (int) Math.Ceiling( (double) count / pageSize ),
 0213                       Items      = query.Skip( ( page - 1 ) * pageSize ).Take( pageSize ).ToList()
 0214                   };
 215    }
 216
 217    /// <summary>Async version of <see cref="GetPaged"/>.</summary>
 218    /// <param name="query">The query, already filtered and ordered.</param>
 219    /// <param name="page">1-based page number; values below 1 read page 1.</param>
 220    /// <param name="pageSize">Rows per page.</param>
 221    /// <param name="cancellationToken">Token to cancel the operation.</param>
 222    /// <returns>The page.</returns>
 223    /// <exception cref="ArgumentOutOfRangeException"><paramref name="pageSize"/> is not positive.</exception>
 224    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 225    protected async Task<PagedResult<TEntity>> GetPagedAsync( IQueryable<TEntity> query, int page, int pageSize, Cancell
 226    {
 0227        ArgumentOutOfRangeException.ThrowIfNegativeOrZero( pageSize );
 228
 0229        page  = Math.Max( page, 1 );
 0230        query = query.AsNoTracking();
 231
 232
 0233        var count = await query.CountAsync( cancellationToken ).ConfigureAwait( false );
 0234        var items = await query.Skip( ( page - 1 ) * pageSize ).Take( pageSize ).ToListAsync( cancellationToken ).Config
 235
 236
 0237        return new PagedResult<TEntity>
 0238                   {
 0239                       PageNumber = page,
 0240                       PageSize   = pageSize,
 0241                       TotalCount = count,
 0242                       TotalPages = (int) Math.Ceiling( (double) count / pageSize ),
 0243                       Items      = items
 0244                   };
 0245    }
 246
 247    /// <summary>Returns the entity set of the shared context, for composing queries.</summary>
 248    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 249    /// <returns>The entity set.</returns>
 4250    protected virtual IQueryable<TEntity> GetQueryable( CancellationToken cancellationToken = default ) => GetDbContext(
 251
 252    /// <summary>Async version of <see cref="GetQueryable"/>.</summary>
 253    /// <param name="cancellationToken">Token to cancel the operation.</param>
 254    /// <returns>The entity set.</returns>
 255    protected virtual async Task<IQueryable<TEntity>> GetQueryableAsync( CancellationToken cancellationToken = default )
 0256        => ( await GetDbContextAsync( cancellationToken ).ConfigureAwait( false ) ).Set<TEntity>();
 257
 258    /// <summary>
 259    /// Returns the entity with key <paramref name="id"/>, <b>tracked</b>: changes to it are saved by the next <c>SaveCh
 260    /// on the same context. Reads are no-tracking everywhere else.
 261    /// </summary>
 262    /// <param name="id">The key.</param>
 263    /// <param name="includes">Navigations to include; <see langword="null"/> for none.</param>
 264    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 265    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 266    /// <returns>The tracked entity, or <see langword="null"/>.</returns>
 267    protected virtual TEntity? GetTracking(
 268            TId id, IEnumerable<Expression<Func<TEntity, object>>>? includes = null, TDbContext? dbContext = null, Cance
 269        )
 4270        => ( dbContext ?? GetDbContext( cancellationToken ) ).Query( tracking: true, null, includes?.ToArray() ).FirstOr
 271
 272    /// <summary>Async version of <see cref="GetTracking"/>.</summary>
 273    /// <param name="id">The key.</param>
 274    /// <param name="includes">Navigations to include; <see langword="null"/> for none.</param>
 275    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 276    /// <param name="cancellationToken">Token to cancel the query.</param>
 277    /// <returns>The tracked entity, or <see langword="null"/>.</returns>
 278    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 279    protected virtual async Task<TEntity?> GetTrackingAsync(
 280            TId id, IEnumerable<Expression<Func<TEntity, object>>>? includes = null, TDbContext? dbContext = null, Cance
 281        )
 282    {
 8283        dbContext ??= await GetDbContextAsync( cancellationToken ).ConfigureAwait( false );
 284
 285
 8286        return await dbContext.Query( tracking: true, null, includes?.ToArray() ).FirstOrDefaultAsync( t => t.Id.Equals(
 8287    }
 288
 289    /// <summary>Saves <paramref name="dbContext"/> through the shared error ladder.</summary>
 290    /// <param name="dbContext">The context.</param>
 291    /// <returns>The number of rows written, or the classified database error.</returns>
 292    protected static LayerResponse<int> SaveChanges( TDbContext dbContext )
 293    {
 20294        ArgumentNullException.ThrowIfNull( dbContext );
 295
 20296        return SafeExecution.ExecuteSafe( () => dbContext.SaveChanges(), dbContext.GetDbErrorClassifier() );
 297    }
 298
 299    /// <summary>Async version of <see cref="SaveChanges"/>.</summary>
 300    /// <param name="dbContext">The context.</param>
 301    /// <param name="cancellationToken">Token to cancel the save.</param>
 302    /// <returns>The number of rows written, or the classified database error.</returns>
 303    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 304    protected static Task<LayerResponse<int>> SaveChangesAsync( TDbContext dbContext, CancellationToken cancellationToke
 305    {
 16306        ArgumentNullException.ThrowIfNull( dbContext );
 307
 16308        return SafeExecution.ExecuteSafeAsync( () => dbContext.SaveChangesAsync( cancellationToken ), dbContext.GetDbErr
 309    }
 310
 311    /// <summary>Marks <paramref name="entity"/> as modified. Nothing is saved.</summary>
 312    /// <param name="entity">The entity.</param>
 313    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 314    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 315    protected virtual void Update( TEntity entity, TDbContext? dbContext = null, CancellationToken cancellationToken = d
 0316        => ( dbContext ?? GetDbContext( cancellationToken ) ).Set<TEntity>().Update( entity );
 317
 318    /// <summary>Updates <paramref name="entity"/> and saves.</summary>
 319    /// <param name="entity">The entity.</param>
 320    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 321    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 322    /// <returns>The number of rows written, or the classified database error.</returns>
 323    protected virtual LayerResponse<int> UpdateAndSave( TEntity entity, TDbContext? dbContext = null, CancellationToken 
 324    {
 8325        dbContext ??= GetDbContext( cancellationToken );
 8326        dbContext.Set<TEntity>().Update( entity );
 327
 328
 8329        return SaveChanges( dbContext );
 330    }
 331
 332    /// <summary>Async version of <see cref="UpdateAndSave"/>.</summary>
 333    /// <param name="entity">The entity.</param>
 334    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 335    /// <param name="cancellationToken">Token to cancel the operation.</param>
 336    /// <returns>The number of rows written, or the classified database error.</returns>
 337    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 338    protected virtual async Task<LayerResponse<int>> UpdateAndSaveAsync( TEntity entity, TDbContext? dbContext = null, C
 339    {
 0340        dbContext ??= await GetDbContextAsync( cancellationToken ).ConfigureAwait( false );
 0341        dbContext.Set<TEntity>().Update( entity );
 342
 343
 0344        return await SaveChangesAsync( dbContext, cancellationToken ).ConfigureAwait( false );
 0345    }
 346
 347    /// <summary>Marks <paramref name="entities"/> as modified. Nothing is saved.</summary>
 348    /// <param name="entities">The entities.</param>
 349    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 350    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 351    protected virtual void UpdateRange( IEnumerable<TEntity> entities, TDbContext? dbContext = null, CancellationToken c
 0352        => ( dbContext ?? GetDbContext( cancellationToken ) ).Set<TEntity>().UpdateRange( entities );
 353
 354    /// <summary>Updates <paramref name="entities"/> and saves.</summary>
 355    /// <param name="entities">The entities.</param>
 356    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 357    /// <param name="cancellationToken">Token to cancel waiting for the context.</param>
 358    /// <returns>The number of rows written, or the classified database error.</returns>
 359    protected virtual LayerResponse<int> UpdateRangeAndSave( IEnumerable<TEntity> entities, TDbContext? dbContext = null
 360    {
 4361        dbContext ??= GetDbContext( cancellationToken );
 4362        dbContext.Set<TEntity>().UpdateRange( entities );
 363
 364
 4365        return SaveChanges( dbContext );
 366    }
 367
 368    /// <summary>Async version of <see cref="UpdateRangeAndSave"/>.</summary>
 369    /// <param name="entities">The entities.</param>
 370    /// <param name="dbContext">The context to use; <see langword="null"/> for the shared one.</param>
 371    /// <param name="cancellationToken">Token to cancel the operation.</param>
 372    /// <returns>The number of rows written, or the classified database error.</returns>
 373    /// <exception cref="OperationCanceledException"><paramref name="cancellationToken"/> was cancelled.</exception>
 374    protected virtual async Task<LayerResponse<int>> UpdateRangeAndSaveAsync( IEnumerable<TEntity> entities, TDbContext?
 375    {
 0376        dbContext ??= await GetDbContextAsync( cancellationToken ).ConfigureAwait( false );
 0377        dbContext.Set<TEntity>().UpdateRange( entities );
 378
 379
 0380        return await SaveChangesAsync( dbContext, cancellationToken ).ConfigureAwait( false );
 0381    }
 382}

Methods/Properties

.ctor(ZhEaIsNsAaBn.Infrastructure.Core.IDbContextProvider`1<TDbContext>)
Add(TEntity,TDbContext,System.Threading.CancellationToken)
AddAndSave(TEntity,TDbContext,System.Threading.CancellationToken)
AddAndSaveAsync()
AddAsync()
AddRange(System.Collections.Generic.IEnumerable`1<TEntity>,TDbContext,System.Threading.CancellationToken)
AddRangeAndSave(System.Collections.Generic.IEnumerable`1<TEntity>,TDbContext,System.Threading.CancellationToken)
AddRangeAndSaveAsync()
Delete(TEntity,TDbContext,System.Threading.CancellationToken)
DeleteAndSave(TEntity,TDbContext,System.Threading.CancellationToken)
DeleteAndSaveAsync()
DeleteRange(System.Collections.Generic.IEnumerable`1<TEntity>,TDbContext,System.Threading.CancellationToken)
GetDbContext(System.Threading.CancellationToken)
GetDbContextAsync(System.Threading.CancellationToken)
GetPaged(System.Linq.IQueryable`1<TEntity>,System.Int32,System.Int32)
GetPagedAsync()
GetQueryable(System.Threading.CancellationToken)
GetQueryableAsync()
GetTracking(TId,System.Collections.Generic.IEnumerable`1<System.Linq.Expressions.Expression`1<System.Func`2<TEntity,System.Object>>>,TDbContext,System.Threading.CancellationToken)
GetTrackingAsync()
SaveChanges(TDbContext)
SaveChangesAsync(TDbContext,System.Threading.CancellationToken)
Update(TEntity,TDbContext,System.Threading.CancellationToken)
UpdateAndSave(TEntity,TDbContext,System.Threading.CancellationToken)
UpdateAndSaveAsync()
UpdateRange(System.Collections.Generic.IEnumerable`1<TEntity>,TDbContext,System.Threading.CancellationToken)
UpdateRangeAndSave(System.Collections.Generic.IEnumerable`1<TEntity>,TDbContext,System.Threading.CancellationToken)
UpdateRangeAndSaveAsync()