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. .NET (Core and Framework)
  4. Entity Framework with Services : several Reference.cs for the same database

Entity Framework with Services : several Reference.cs for the same database

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdatabasehelpsql-serverwcf
1 Posts 1 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.
  • W Offline
    W Offline
    WolveFred2
    wrote on last edited by
    #1

    Hi, I have got a problem. In a web project in 3.5, I have : - a Entity Framework model, linked to a SQL Server 2005 database - two services : 1) a ADO.Net Data Service (ex-Astoria) 2) a WCF Service These two services are both linked to the Entity model. In the client project (it's Silverlight), I added two references, for each of the services. VS2008 creates for me two Reference.cs files, one for each service. The problem is that the two files are containing the same definitions of entities, but VS2008 consider that they are different, because they belongs to two different namespaces. Therefore, if I want to use the two services in the same class, I get an error of ambiguous reference between the two definitions. So I can only use one service in the same class :/ The problem would be resolved if the entities would be defined once. Would it be possible to have only one definition of the entities for the two services reference ?

    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