public IDatabase RedisCache(int idDb) { Console.WriteLine("idDb: " + idDb); switch (idDb) { case 1: return(ConnectionRU.GetDatabase()); case 2: return(ConnectionEU.GetDatabase()); case 3: return(ConnectionUSA.GetDatabase()); default: return(ConnectionRU.GetDatabase()); } }
public static string SearchValueById(string id, int idDb) { var dbrus = ConnectionRU.GetDatabase(); var dbeu = ConnectionEU.GetDatabase(); var dbusa = ConnectionUSA.GetDatabase(); switch (idDb) { case 1 when dbrus.KeyExists(id): return(dbrus.StringGet(id)); case 2 when dbeu.KeyExists(id): return(dbeu.StringGet(id)); case 3 when dbusa.KeyExists(id): return(dbusa.StringGet(id)); default: return(null); } }