views:

17

answers:

1

I am having the following data structure:

 [DataContract]
 public class OperationResult<T>
 {
    public OperationResult() { }

    [DataMember]
    public Int32 OpResult
    {
        get;set;
    }

    [DataMember]
    public IList<T> OperationResults
    {
        get;set;
    }

    public static OperationResult<T> Success(IList<T> results, int numberOfChangedObjects)
    {
        OperationResult<T> result = new OperationResult<T>();

        result.OpResult = 1;
        result.OperationResults = results;

        return result;
    }        
}

When I update the service reference, the class does not get serialized. In the service I am using a so-called closed generic type eg.

  [OperationContract]
  public OperationResult<Int32> SometTestMethod()
   {
       return new OperationResult<Int32>
                  {
                      OpResult = 1,
                      OperationResults = new List<Int32> {1, 2, 3}
                  };
   }

The method is exposed, but the return type OperationResult in this case is not accesible. What am I doing wrog? Thanks

A: 

I just realized. The reason I didn't find the type is because I was looking for an OperationResult. As it got serialized , it was named OperationResultOfInt.

MadalinaA