WCF exposing generic type 'T'

后端 未结 3 1570
走了就别回头了
走了就别回头了 2020-12-11 07:07

I write a WCF service for Insert and delete operation here we used generic method but it gives following error \"System.Runtime.Serialization.InvalidDataContractException: T

3条回答
  •  醉酒成梦
    2020-12-11 07:15

    I think it is imposible, how could it generate the wsdl that way?

    You have two options:

    • You could send the type as a parameter.

    • If you want to expose crud operations for entities I would recommend to use a code generator, maybe a T4 template for EF.

提交回复
热议问题