In line six, instead of:
Console.WriteLine((string) dotNetcategory);

line six should be:
Console.WriteLine((string)name);