Hi, this is my first WCF service. I defined a response message that derives from a Dictionary like this:
[CollectionDataContract(ItemName = "Product", KeyName = "ProductNumber", ValueName = "ProductName")]
public class GetAvailableProductsResponse : Dictionary<string, string> { }
When I try to run the following code in a service operation it throws an exception for not being able to cast:
Dictionary<string, string> result = new Dictionary<string, string>();
GetAvailableProductsResponse responseMsg = (GetAvailableProductsResponse)result;
In reality I don't instantiate a new Dictionary but I'm calling a business object which returns a Dictionary so I need to cast this to the response message somehow.
This might be an issue of casting a Dictionary in general rather than a WCF specific question, isn't it?
Many thanks in advance!