Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. WCF question

WCF question

Scheduled Pinned Locked Moved Windows API
questioncsharpwcftutorialworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    muharrem
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • M 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

      S Offline
      S Offline
      Scott Dorman
      wrote on last edited by
      #2

      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]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups