Redis Hash Datatype for .NET developers
Redis Hash Datatype are similar to Dictionary in C#. Redis Hash datatype is a mapping of key as string and value as a string. Redis hashes are memory optimized. var hashKey = “hashKey” ; HashEntry [ ] redisMerchantDetails = { new HashEntry ( “Name” , “Ravindra Naik” ) , new HashEntry ( “Age” , 26 ) , new HashEntry ( “Profession” , “Software Engineer” ) } ; redis . HashSet ( hashKey , redisMerchantDetails ) ; if ( redis . HashExists ( hashKey , “Age” ) ) { var age = redis . HashGet ( hashKey , “Age” ) ; //Age is 26 } var allHash = redis . HashGetAll ( hashKey ) ; //get all the items foreach ( var item in allHash ) { //output //key: Name, value: Ravindra Naik //key: Age , value: 26 //key: Profession, value: Software Engineer Console . WriteLine ( string . Format ( “key : {0}, value : {1}” , item . Name , item . Value ) ) ; } //get all t