none
how to enable include foreign key checkbox in entity framework model. RRS feed

  • Question

  • Hello All,

    when i am creating entity data model then it hides checkbox of include foreign key in model.

    please help to solve this issue.

    

    Friday, September 20, 2013 1:23 PM

Answers

  • Hi Mukesh

          Refer this link. It may help you.

    Thanks

    Sowmiya 

    Friday, September 20, 2013 1:37 PM
  • Hello Mukesh Kumar Bhagat,

    Thanks for visiting this forum.

    For this issue, as far as I know, if you use Visual Studio 2010 and target .NET Framework 3.5 in your project settings, the checkbox will be disable. This checkbox doesn't exist at all in VS2008 and when targeting .NET 4.0 in VS2010 it isn't disabled.

    And this checkbox does NOT mean that no Entity relationships would be created from tables linked by foreign key constraints. They WILL be created, also in Entity Framework 1.0.

    You only won't have scalar Entity properties which represent your foreign key columns. (This checkbox - only available in .NET 4 -, being checked, will include those properties in the model.) Instead you always have to deal with the referenced objects in your entities.

    When working with relationships in the Entity model in .NET 3.5, the foreign key constraints are still represented correctly and automatically created.

    If I have misunderstood, please let me know.

    Thanks &Regards.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 23, 2013 3:45 AM
    Moderator

All replies

  • Hi Mukesh

          Refer this link. It may help you.

    Thanks

    Sowmiya 

    Friday, September 20, 2013 1:37 PM
  • Hello Mukesh Kumar Bhagat,

    Thanks for visiting this forum.

    For this issue, as far as I know, if you use Visual Studio 2010 and target .NET Framework 3.5 in your project settings, the checkbox will be disable. This checkbox doesn't exist at all in VS2008 and when targeting .NET 4.0 in VS2010 it isn't disabled.

    And this checkbox does NOT mean that no Entity relationships would be created from tables linked by foreign key constraints. They WILL be created, also in Entity Framework 1.0.

    You only won't have scalar Entity properties which represent your foreign key columns. (This checkbox - only available in .NET 4 -, being checked, will include those properties in the model.) Instead you always have to deal with the referenced objects in your entities.

    When working with relationships in the Entity model in .NET 3.5, the foreign key constraints are still represented correctly and automatically created.

    If I have misunderstood, please let me know.

    Thanks &Regards.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 23, 2013 3:45 AM
    Moderator