开发者

C# send generated classes from diagram through webservice problem

I have problem with sending a object from my webservice.

I have created a diagram with a product Entity... then I generated the database... C# generates a few classes in a ...Designer.cs file.

In that file I have the class Product which with the following:

     [EdmEntityTypeAttribute(NamespaceName="WinkelModel", Name="Product")]
     [Serializable()]
     [DataContractAttribute(IsReference=true)]
     public partial class Product : EntityObject

I created a webservice with the following method:

public Product[] GetProducts()
    {
        using (WinkelModelContainer wmc = new WinkelModelContainer())
        {
            var products = from p in wmc.Products select p;
            return products.ToArray();                
        }
    }

But when I start the WCF Test Client to test my webservice I get the following when I want to test this method:

This operation is not supported in the WCF Test开发者_运维问答 Client because it uses type Product

Does anyone has a solution for this problem?

Thanks in advance!


I solved it... This isn't possible in C#. I have to create a seperate class with the same information and send this class with my webservice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜