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 7038481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:40:28+00:00 2026-05-28T01:40:28+00:00

Does EF 4 support unidirectional one-to-many associations, as in: public class Parent { public

  • 0

Does EF 4 support unidirectional one-to-many associations, as in:

public class Parent
{
  public int Id { get; set; }
  public string Something { get; set; }
  public List<Child> AllMyChildren { get; set; }
}

public class Child
{
  public int Id { get; set; }
  public string Anotherthing { get; set; }
  // I don't want a back-reference to the Parent!
  // public int ParentId { get; set; }
}

When I try to compile my project with an association between Parent and Child where End2 Navigation is blank (because I unchecked the End2 Navigation Property checkbox in the Add Association dialog), I get

Error 2027: No mapping specified for the following EntitySet/AssociationSet – Child.

UPDATE:

And what if I just have a List or similar property on Parent rather than a List? Do I need to create a wrapping type to hold the String so that I can also hold a back-reference to Parent?

  • 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-28T01:40:29+00:00Added an answer on May 28, 2026 at 1:40 am

    Belive that this would work using Fluent API (Only way of deifning unidirectional associations)

    modelBuilder.Entity<Child>()
    .HasKey(t => t.Id);
    
    modelBuilder.Entity<Parent>()
    .HasMany(p => p.AllMyChildren)
    .WithRequiredPrincipal();
    

    http://msdn.microsoft.com/en-us/library/hh295843(v=VS.103).aspx

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

Sidebar

Related Questions

I'd like to be sure if vestal_versions does support versioned associations (it seems like
Does iPhone support XML-RPC, Is their any open source framework which I can use?
Does WPF support using a triggers that respond to routed events but only given
Does ODBC support asynchronous calls? If it does, then can you tell me about
Does silverlight support the remoting functionality of the .net framework?
Does Xcode support anything akin to Visual Studio style #region directives for arbitrary code
Does Xcode support tail-call optimization on the iPhone?
Does MySQL support MSDTC?
Does RabbitMQ support a scenario where a received message acknowledgement is sent on the
Does ASIHTTP support multi thread? If sure, I hope each thread link to aUIProgressbar,

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.