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. LINQ
  4. Serializing Linq

Serializing Linq

Scheduled Pinned Locked Moved LINQ
csharpdatabasewcflinqoop
2 Posts 2 Posters 5 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.
  • F Offline
    F Offline
    Flo Lee
    wrote on last edited by
    #1

    Hello, in my app framework we have different .NET services on either the same or different physical machines. The current .NET Remoting may or may not be switched to WCF one day. Regardless of that I did not find a statement on the web if it is possible to serialize a Linq request and get the reply back over the wire. Currently we are using handcrafted abstraction objects for the query part and return DataTables, Scalars etc... any ideas? thanks Florian

    U 1 Reply Last reply
    0
    • F Flo Lee

      Hello, in my app framework we have different .NET services on either the same or different physical machines. The current .NET Remoting may or may not be switched to WCF one day. Regardless of that I did not find a statement on the web if it is possible to serialize a Linq request and get the reply back over the wire. Currently we are using handcrafted abstraction objects for the query part and return DataTables, Scalars etc... any ideas? thanks Florian

      U Offline
      U Offline
      User 3625300
      wrote on last edited by
      #2

      Out of the box EF4 entity objects do not support serialization. You need to convert your model to POCO objects using the ‘ADO.NET POCO Entity Generator’ or the ‘ADO.NET DbContext Generator’(depending on your EF4 version). This can be done automatically by right-clicking on the model design surface and selecting ‘Add Code Generated Item’. From the dialog, select ‘Online Templates’ and the desired generator. Type a name for your T4 template (your model name). A simple POCO class will be created for each entity. To send and receive the POCO classes over the wire via WCF you will need to add some class files/ class project (CyclicReferencesAware and DataContractResolver) and some supporting attributes to the code generated web services interface classes. Here are some links (walk troughs) that explain the process. http://www.sanderstechnology.com/2010/the-ado-net-entity-framework-poco-objects-and-you/10142/ http://blogs.msdn.com/b/adonet/archive/2010/01/25/walkthrough-poco-template-for-the-entity-framework.aspx

      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