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

  • Home
  • SEARCH
  • 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 5939963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:54:06+00:00 2026-05-22T15:54:06+00:00

I have a Project entity and an Rfi entity. The project entity contains a

  • 0

I have a Project entity and an Rfi entity. The project entity contains a list of TeamMembers. Project is a navigation property in the Rfi entity. In the Rfi entity there is a RecipientId. This Id represents a person from the TeamMembers collection. So imagine, on a web page, we have a drop down box named Recipient. The list includes all team members of the Project. The user will select a Contact from that list. The Id of that contact will be saved in the RecipientsId property. When the page is reloaded we will select the Id of that user in the drop down based off the value in the RecipeintsId property. What is the best way to map this in EF 4.1 using the fluent API?

    public class Project : BaseEntity
    {
        public string ProjectNumber { get; set; }
        public string Description { get; set; }

        public string CreatedBy { get; set; }
        public string ModifiedBy { get; set; }
        public string Currency { get; set; }


        #region Navigation Properties
        public Guid AddressId { get; set; }
        public virtual Address Address { get; set; }
        public Guid CompanyCodeId { get; set; }
        public virtual CompanyCode CompanyCode { get; set; }
        public virtual ICollection<Contact> TeamMembers { get; set; }
        #endregion

    }


    public class Rfi : Document
    {
        public string Number { get; set; }
        public string Subject { get; set; }
        public string SubcontractorRfiReference { get; set; }
        public string SpecificationSection { get; set; }

        public RfiStatus RfiStatus { get; set; }

        public Guid RecipientId { get; set; }


        #region Navigation Properties
        public Guid ProjectId { get; set; }
        public Project Project { get; set; }
        #endregion
    }
  • 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-22T15:54:07+00:00Added an answer on May 22, 2026 at 3:54 pm

    As I understand it your problem is mapping between Rfi and Contect – Project doesn’t have any role in your Recipient functionality from the database perspective.

    You need either Recipient navigation property in Rfi or Rfis navigation property in Contact. EF code first needs navigation property on at least one side of the relation.

    So you can use something like:

    public class Rfi : Document
    {
        public string Number { get; set; }
        public string Subject { get; set; }
        public string SubcontractorRfiReference { get; set; }
        public string SpecificationSection { get; set; }
    
        public RfiStatus RfiStatus { get; set; }
    
        #region Navigation Properties
        public Guid RecipientId { get; set; }
        public Contact Recipient { get; set; }
        public Guid ProjectId { get; set; }
        public Project Project { get; set; }
        #endregion
    }
    

    And map:

    modelBuilder.Entity<Rfi>()
                .HasRequired(r => r.Recipient)
                .WithMany()
                .HasForeignKey(r => r.RecipientId);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found this example on StackOverflow: var people = new List<Person> { new
I have a Project entity and a Group entity. I can get a Project
I have: Task Entity that holds a foreignkey to a Project Entity. In the
I have a project where the client is using Entity Framework, and I'm trying
I have c# project that is using sqlserver compact edition and entity framework for
We have a project that uses JPA/Hibernate on the server side, the mapped entity
I have a project in Asp net mvc. An entity called product can not
I have object Project in my entity. I create project by: public static void
I have project that I'm working on that is going to require a webserver.
I have a project that I'm currently working on but it currently only supports

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.