WCF question
-
Is it possible to have following logic in WCF environment, [DataContract] class MyDataContract { } [DataContract] class MyOtherDataContract { } [ServiceContract] interface IMyServiceContract { [OperationContract] void MyMethod(Object obj); } public class MyService : IMyServiceContract { public void MyMethod(Object obj) { if (obj is MyDataContract) { //do something on MyDataContract object } else if (obj is MyOtherDataContract) { //do something on MyOtherDataContract object } } } If this was not possible, how to pass different class objects to the same service method? Thanks to everybody Muharrem
-
Is it possible to have following logic in WCF environment, [DataContract] class MyDataContract { } [DataContract] class MyOtherDataContract { } [ServiceContract] interface IMyServiceContract { [OperationContract] void MyMethod(Object obj); } public class MyService : IMyServiceContract { public void MyMethod(Object obj) { if (obj is MyDataContract) { //do something on MyDataContract object } else if (obj is MyOtherDataContract) { //do something on MyOtherDataContract object } } } If this was not possible, how to pass different class objects to the same service method? Thanks to everybody Muharrem
First, please use <pre> tags for large code blocks like this. Secondly, have you tried to compile this code?
Scott.
—In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]