I am using StackExchange.Redis to access a Redis instance.
I have the following working C# code:
public static void Demo()
{
ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("xxx.redis.cache.windows.net,ssl=true,password=xxx");
IDatabase cache = connection.GetDatabase();
cache.StringSet("key1", "value");
}
Here is the what I would hope would be the equivalent F# code:
let Demo() =
let cx = ConnectionMultiplexer.Connect @"xxx.redis.cache.windows.net,ssl=true,password=xxx"
let cache = cx.GetDatabase()
cache.StringSet("key1", "value") |> ignore
However this does not compile - 'No overloads match for method StringSet'. The StringSet method expects arguments of type RedisKey and RedisValue, and there seems to be some compiler magic going on in C# to convert the strings in the calling code into RedisKey and RedisValue. The magic does not appear to exist in F#. Is there a way of achieving the same result?