Console.ReadLine
returns a string, not a single character. So you need to compare it with a string. String literals uses double quotes, not single quotes. Also, you want the equality comparison operator (==
) rather than the assignment operator (=
):
if (input == "h")
To be honest, if you're sufficiently inexperienced in C# that this is causing you problems, I suggest you take a step back and learn the basics of C# in a more "normal" environment (e.g. console or client apps) first, before venturing into Cosmos. I haven't done any Cosmos work myself, but I suspect there will be some pretty tricky areas, which will be made much harder by not having a solid grounding in C# first.