RIA Services - Two entity models share an entity name

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-06-17T18:25:13Z Indexed on 2010/06/17 20:03 UTC
Read the original article Hit count: 240

I have two entity models hooked up to two different databases. However, the two databases both have a table named 'brand', for example. As such, there is a naming conflict in my models. Now, I've been able to add a namespace to each model, via Custom Tool Namespace in the model's properties, but the generated code in my Silverlight project will try to use both namespaces, and come up with this,

Imports MyProject.ModelA
Imports MyProject.ModelB

Public ReadOnly Property brands() As EntitySet(Of brand)
    Get
        Return MyBase.EntityContainer.GetEntitySet(Of brand)
    End Get
End Property

giving me this exception:

'Error 1 'brand' is ambiguous, imported from the namespaces or types 'MyProject.ModelA,MyProject.ModelB'.

Has anyone had experience with naming conflicts like this using RIA services? How did you solve it?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about entity-framework