IDbContextService.cs 975 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.Entity;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using GreenTree.Nachtragsmanagement.Core;
  8. using GreenTree.Nachtragsmanagement.Data;
  9. namespace GreenTree.Nachtragsmanagement.Services.DbContext
  10. {
  11. interface IDbContextService
  12. {
  13. /// <summary>
  14. /// Checks if a DbSet exists in the curent DbContext
  15. /// </summary>
  16. /// <typeparam name="TEntity">The entity type of the DbSet.</typeparam>
  17. bool DbSetExists<TEntity>() where TEntity : BaseEntity;
  18. /// <summary>
  19. /// Get the DbSet of the corresponding Entity type
  20. /// </summary>
  21. /// <typeparam name="TEntity">The entity type of the DbSet.</typeparam>
  22. IDbSet<TEntity> GetDbSet<TEntity>() where TEntity : BaseEntity;
  23. /// <summary>
  24. /// Gets the current DbContext
  25. /// </summary>
  26. AppendixObjectContext GetDbContext();
  27. }
  28. }