Serializing data with IEnumerable <T> using WebGet
possible duplicate:
It is not possible to serialize a parameter of type "System.Linq.Enumerable ... when using WCF, LINQ, JSON
Hi,
If my method signature looks like this, it works fine.
[WebGet]
MyClass[] WebMethod()
If the sign looks like this:
[WebGet]
IEnumerable<T> WebMethod()
I get the following error: Unable to serialize a parameter of type "XYZT + <WebMethod> d__2c" (for operation "WebMethod", contract "IService"), because it is not the exact type "System.Collections.Generic.IEnumerable`1 [XYZT]" in and is not in the collection of known types. To serialize a parameter, add the type to the collection of known types for the operation using ServiceKnownTypeAttribute.
I tried to add. ServiceKnownType (TypeOf (IEnumerable))
.
- 2 2010 , , , ?
+3