No Description

IDbContext.cs 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Microsoft.EntityFrameworkCore;
  2. using Microsoft.EntityFrameworkCore.ChangeTracking;
  3. using Microsoft.EntityFrameworkCore.Infrastructure;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. namespace Backend.ApplicationCore.Interfaces.IRepositories
  9. {
  10. #pragma warning disable EF1001 // Internal EF Core API usage.
  11. public interface IDbContext : IDisposable
  12. {
  13. ChangeTracker ChangeTracker { get; }
  14. DatabaseFacade Database { get; }
  15. EntityEntry Attach(object entity);
  16. EntityEntry<TEntity> Attach<TEntity>(TEntity entity) where TEntity : class;
  17. void AttachRange(IEnumerable<object> entities);
  18. void AttachRange(params object[] entities);
  19. EntityEntry Entry(object entity);
  20. EntityEntry<TEntity> Entry<TEntity>(TEntity entity) where TEntity : class;
  21. TEntity Find<TEntity>(params object[] keyValues) where TEntity : class;
  22. object Find(Type entityType, params object[] keyValues);
  23. ValueTask<object> FindAsync(Type entityType, object[] keyValues, CancellationToken cancellationToken);
  24. ValueTask<object> FindAsync(Type entityType, params object[] keyValues);
  25. ValueTask<TEntity> FindAsync<TEntity>(object[] keyValues, CancellationToken cancellationToken) where TEntity : class;
  26. ValueTask<TEntity> FindAsync<TEntity>(params object[] keyValues) where TEntity : class;
  27. EntityEntry Remove(object entity);
  28. EntityEntry<TEntity> Remove<TEntity>(TEntity entity) where TEntity : class;
  29. void RemoveRange(IEnumerable<object> entities);
  30. void RemoveRange(params object[] entities);
  31. int SaveChanges(bool acceptAllChangesOnSuccess);
  32. int SaveChanges();
  33. Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default);
  34. Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
  35. DbSet<TEntity> Set<TEntity>() where TEntity : class;
  36. EntityEntry Update(object entity);
  37. EntityEntry<TEntity> Update<TEntity>(TEntity entity) where TEntity : class;
  38. void UpdateRange(IEnumerable<object> entities);
  39. void UpdateRange(params object[] entities);
  40. }
  41. #pragma warning restore EF1001 // Internal EF Core API usage.
  42. }

Powered by TurnKey Linux.