You cannot define a class field using var.
Change var to Dictionary<string, Dictionary<string, string>>:
public Dictionary<string, Dictionary<string, string>> info =
new Dictionary<string, Dictionary<string, string>>
{
{
"Gen",
new Dictionary<string, string>
{
{"name", "Genesis"},
{"chapters", "50"},
{"before", ""},
{"after", "Exod"}
}
},
{
"Exod",
new Dictionary<string, string>
{
{"name", "Exodus"},
{"chapters", "40"},
{"before", "Gen"},
{"after", "Lev"}
}
}
};
See here for more information about var keyword and its usage.
In C# 9, with the introduction of target-typed new expressions, you can rewrite the field definition as:
public Dictionary<string, Dictionary<string, string>> info = new()
{
{
"Gen",
new Dictionary<string, string>
{
{"name", "Genesis"},
{"chapters", "50"},
{"before", ""},
{"after", "Exod"}
}
},
{
"Exod",
new Dictionary<string, string>
{
{"name", "Exodus"},
{"chapters", "40"},
{"before", "Gen"},
{"after", "Lev"}
}
}
};
var..?Dictionary<string, string>as the value anyway, when it appears you really want a simpleChapterclass?