lovecraft
lovecraft

Reputation: 13

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.

Upvotes: 1

Views: 164

Answers (1)

Dave Doknjas
Dave Doknjas

Reputation: 6542

Maybe you mean:

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

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

Upvotes: 2

Related Questions