示例#1
0
        protected void InsertEntity <T>(T bankAccountEntity) where T : EntityBase
        {
            using var context = new SinanceContext(_dbContextOptions, _userIdProvider);

            context.Set <T>().Add(bankAccountEntity);
            context.SaveChanges();
        }
示例#2
0
 protected void InsertEntities <T>(params T[] bankAccountEntities) where T : EntityBase
 {
     using var context = new SinanceContext(_dbContextOptions, _userIdProvider);
     context.Set <T>().AddRange(bankAccountEntities);
     context.SaveChanges();
 }
示例#3
0
 protected async Task <bool> EntityExistsById <T>(int id) where T : EntityBase
 {
     using var context = new SinanceContext(_dbContextOptions, _userIdProvider);
     return(await context.Set <T>().AnyAsync(x => x.Id == id));
 }