简体   繁体   中英

C# Deserializing to a dictionary<string, Object>

I'm writing a C#/VB application to connect to a database and do stuff with the data. I was given this code to take a serialized byte array and deserialized it, which is then written to a Dictionary The line of code is:

Dictionary<string, Object> DictionaryEmployee = (Dictionary<string, Object> Deserializer(byteArrayEmp));

The errors I'm getting are exceedingly unhelpful. "Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement" if I mouse over Object and "Using the generic type 'System.Collections.Generic.Dictionary' requires 2 type arguments if I mouse over Dictionary.

Maybe you mean:

Dictionary<string, Object> DictionaryEmployee = (Dictionary<string, Object>) Deserializer(byteArrayEmp);

It's just a misplacement of the cast closing parenthesis.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM