I have a bigger project that uses multiple edmx files to manage the data model for an asp.net application. What I want to achieve is to link two entities accross two edmx models.
So basically, just a foreign key like this: EntityA.ForeignEntityId --> EntityB.Id
However, since the enitites are not in the same model, I cannot add this foreign key in the model designer. I know that I could do it manually by either modifying the auto-generated SQL-file or by adding the relation in the SQL Server Manager. Both these approaches have the massive downside that they are not easily maintainable because if I do "Create database from model" and run the resulting SQL script, my manual modifications are dropped (I thnink?).
So is there a way of referencing a foreign entity from another edmx model in the model designer?
Entity Framework: association between two edmx models
234 Views Asked by Cleo At
1
There are 1 best solutions below
Related Questions in ASP.NET
- Create an IIS web request activity light
- Writing/Overwriting to specific XML file from ASP.NET code behind
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- Getting deeply embedded XML element values
- What is best way to check if any of the property of object is null or empty?
- NuGet - Given a type name or a DLL, how can I find the NuGet package?
- ASP-MVC Code-first migrations checkbox not active
- How do i add onclient click to my jquery button
- Jquery: Change contents of <select> tag dynamically
- Retrieving data from Oracle database
- ASP.NET: Fill Textbox field upon dropdownlist selection by user
- Why web API return 404 when deploy to IIS
Related Questions in ENTITY-FRAMEWORK
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- How to get primary key value with Entity Framework Core
- How do you add extra property using join
- Is there anyway to set the relationship of many tables from Model?
- ORM Code First versa Database First in Production
- MVC : Insert data to two tables
- Cannot insert a null into column MVC ASP.NET
- System.ComponentModel.DataAnnotations.Schema namespace conflict
- EF 6 interceptor to set connectionstring
- IQueryable<T> OrderBy<T> Extension Fails with Foreign Key Property
- Linq to Entities filter navigation collection properties
- How to generate entity framework code-first migrations without using the package manager console?
- Entity Framework and abstract class
- Validation DataGridView Windows Forms
- Require tool to trace the LInq Queries in Oracle
Related Questions in FOREIGN-KEYS
- Msg 547- FK Constraint Error
- JPA, Hibernate can I do composite primary key which one element is foreign kay @OneToMany?
- django - "Incorrect type. Expected pk value, received str" error
- How to use django model with foreign key ? Help plss
- belongs_to with foreign_key not working in one direction
- How to prevent inserting duplicate rows based on two foreign keys?
- Cakephp hasMany with multiple foreign keys that are not primary keys
- Sql: Selecting from other tables
- Django admin with inlines, 1 model with 2 foreigns keys to 2 different models
- MySQL Foreign Key Constraint Fail
- How to set "auto insert" foreign key value by using SQL Server?
- delete a record and its FOREIGN key via a sql query
- SQL alchemy - specifying relationships when foreign key may not exist
- Foreign key not updating in entity frame work
- @OneToMany and @ManyToOne foreign key always Null
Related Questions in EDMX-DESIGNER
- How to enable cascading delete in Edmx Designer on many to many relation
- EDMX is overwriting Key data annotations
- EDMX .NET 4.5 to 4.0?
- Can't open EDMX-file in designer
- Entity Framework: association between two edmx models
- SQLite ef edmx designer in Visual Studio 2013 update 4 for database first targetting .net framework 4
- Something to create labels and regions in entity framework designer?
- Why edmx diagram doesn't create the data annotations
- How to know what the foreign keys are for?
- Combine columns in entity framework into one column with the edmx designer
- asp.net mvc entity framework with multiple databases
- How do I find a specific table in my EDMX model quickly?
- Entity Framework / EDMX : TablePerTypeStrategy not fully implemented?
- Alternate way to get to "Update model from Database" and Model Browser without opening up edmx file using ADO.NET Entity Model Designer?
- Generating ef edmx faild: operation not valid due to current state of the object
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I know this is old but i found myself with the same problem. If you create the reference in SQL and update your model from the database it will pull in the table that is referenced. I don't think this really solves the problem we have but it will at least allow for you to go back and forth without losing any FKs.