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?
Found the solution.
Unload the client (Silverlight) project.
Right click the unloaded project and edit the .csproj or .vbproj file.
Add <RiaClientUseFullTypeNames>true</RiaClientUseFullTypeNames>
inside the <PropertyGroup>
tag
Reload project. Do a full rebuild.
Now the generated code will use full type names (i.e., MyProject.ModelA.brand)