WCF DataContract vs DataContract Interface

后端 未结 2 960
隐瞒了意图╮
隐瞒了意图╮ 2021-02-20 13:10

New to WCF.

Can DataContact class inherit from Interface ?

eg:

[DataContract(Namespace = ...........)]
public class VesselSequence : IVesselSeque         


        
2条回答
  •  无人共我
    2021-02-20 13:57

    sure it can, but keep in mind if you are returning the interface type you have to define the KnownTypes attribute for deserialization engine, so it could deserialize your sent interface at the other end.

提交回复
热议问题