public void Update(TEntity inputEntity) { if (_appStoreDBContext.Set <TEntity>().Local.Any <TEntity>(e => e == inputEntity)) { _dbSet.Update(inputEntity); } else { throw new KeyNotFoundException("The entity you tried to update does not exist"); throw new Exception(); } }
public GenericRepository(PlayStoreDBContext appStoreDBContext) { _appStoreDBContext = appStoreDBContext; _dbSet = appStoreDBContext.Set <TEntity>(); }