Results 1 to 2 of 2

Thread: WCF using EF 4.1

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    WCF using EF 4.1

    Hi All,

    I'm using the EF4.1 to interact with the underlying DB. I Need to expose the DBContext etc via a WCF Service, what is the best way to do this I'm using VS2010

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    Re: WCF using EF 4.1

    Ok, I've realised that I cannot use the context directly since this cannot be serialised. instead, I have done the following and now my question changes slightly. I have also had to move to EF5.0

    HI All,

    In a WCF project I have used the entity Framework. The framework was built from an existing DB. This is fine. I have added the ADO.NET -self tracking entity generator template to my wcf project and this has created a bunch of classes as expected based on my model.

    In a standard project using EF, I would work against the ObjectContext. However, in a WCF project the ObjectContext cannot be serialised. Because I've introduced the self-tracking template, I can expose my objects individually to whoever wants to use the service. However, what is the best way to accept updates, since typically I'd probably want to update more than 1 table at once. Are there any good code examples on how to use this template with WCF?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width