Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3932736
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:31:22+00:00 2026-05-19T23:31:22+00:00

I have two entity sets with entities of the same name with properties of

  • 0

I have two entity sets with entities of the same name with properties of the same name. Hence:

 FormsEntities formEntities2011 = new FormsEntities2011();
 FormsEntities formEntities2010 = new FormsEntities2010();

And I have queries for each:

 // -- Get a list of Clients from the 2010 Database for this agent
 var clients2010Query = from c in formsEntities2010.Clients
                        join ac in formsEntities2010.Agent_Client on c.Client_ID equals ac.Client_ID
                        where ac.Agent_ID == a.Agent_ID
                        orderby c.Client_ID
                        select c;

But I get an error on the join statement regarding ambiguity between Clients. I believe this is because the formEntities2011 and the formEntities2010 both have a Client entity.

Normally I would just add the namespace to resolve the ambiguity, but I don’t know how to do that in a Linq statement?

The error is “The member is defined more than once” on c.Client_ID and ac.Client_ID

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T23:31:23+00:00Added an answer on May 19, 2026 at 11:31 pm

    If you want to explicitly assign a type, try using extension methods and Cast.

    var c2010 = formsEntities2010.Clients
                    .Join( formsEntities1010.Agent_Client
                                            .Where( ac => ac.Agent_ID == a.Agent_ID ),
                           c => c.Client_ID,
                           ac => ac.Client_ID,
                           (c,ac) => c )
                    .Cast<Forms2010.Client>(); // or whatever namespace you choose
    

    I would be surprised, though, if this affected your problem since it seems to me that it is having difficulty determining which fields to use as the join keys.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two entities // All details has been removed @Entity @Table(name = "A_TABLE_NAME")
I have two entities: @Entity Article { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id;
I have two entities types: RunContainer parent entity type Run child entity type Run
I have the following two entities: @Entity class Relation{ @ManyToOne private User user; //some
In my program I have two classes: Collector and Entity. Collector stores Entities in
I have an Entity Item in Core Data. Item has two attributes: name and
I have ThirdParty entity and two derived entities: Supplier and Customer. I have another
I have two simple entities: My\Entity\Coupon: type: entity table: coupon id: id: type: integer
I have two image properties in my entity: Thumbnail and HiResPhoto, and I am
I have the following two entities: @Entity public class SupermarketChain { @Id @GeneratedValue(strategy =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.