protected void InsertEntity <T>(T bankAccountEntity) where T : EntityBase { using var context = new SinanceContext(_dbContextOptions, _userIdProvider); context.Set <T>().Add(bankAccountEntity); context.SaveChanges(); }
protected void InsertEntities <T>(params T[] bankAccountEntities) where T : EntityBase { using var context = new SinanceContext(_dbContextOptions, _userIdProvider); context.Set <T>().AddRange(bankAccountEntities); context.SaveChanges(); }
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)); }