DbAppServiceBase.cs 600 B

12345678910111213141516171819
  1. using VCommon.Ioc;
  2. using VCommon.VApplication;
  3. using VCommon.VApplication.EntityFrameworkCore;
  4. using VCommon.VEntity;
  5. using VCommonCoreExample.Audit;
  6. using VCommonCoreExample.EntityFrameworkCore;
  7. namespace VCommonCoreExample.AppServices.Basic
  8. {
  9. public class DbAppServiceBase : AppServiceBase
  10. {
  11. protected ExampleDbContext GetDbContext() => IocManager.Resolve<ExampleDbContext>();
  12. }
  13. public class DbTableAppServiceBase<TEntity> : AppServiceBase where TEntity : VEntityBase
  14. {
  15. protected VAppEfRepository<ExampleDbContext, TEntity> GetRepository() => new();
  16. }
  17. }