I am about to begin a new project which will target an existing database with some existing tables with data. As part of my project, i will create some new tables and make relation ships with the existing tables ? Which approach is better in this scenario. I believe code first will be a problem because i don't want to loose my data every time when i make a change to the table structure (for my new table).
What is the best approach to create new tables in existing db with data?
300 Views Asked by Happy At
1
There are 1 best solutions below
Related Questions in .NET
- Does compiler optimize operation on const variable and literal const number?
- 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
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- .net rest service with JSON string and consumed with java client
- What is best way to check if any of the property of object is null or empty?
- Telerik's WPF RadColorPicker NoColorText property not working
- Possible consequences of duplicate ProgId for different classes
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Optimizing C++ call from C#
- Make a per-web-application object available to Web API and SignalR controllers
- System.ComponentModel.DataAnnotations.Schema namespace conflict
- LINQ Except/Distinct based on few columns only, to not add duplicates
- Not displaying content by its URL string - absolute urls
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 EF-CODE-FIRST
- ASP-MVC Code-first migrations checkbox not active
- ORM Code First versa Database First in Production
- EF 6 interceptor to set connectionstring
- How to generate entity framework code-first migrations without using the package manager console?
- MultiTenant Application Prevent Tenant Access Data from Other Tenant in Shared Database
- EF Code First One To Many. Cannot Seed
- Entity Framework Decimal Truncation Issue
- Entity Framework Search for Enum pulls back all data
- Entity Framewrok Code First: Can not rename FK in optional 1:1 relationship
- Updating entity with many to many relationship
- Entity Framework inheritance composite key
- Setting default values for Complex Properties - Backfilling database
- EF Code First - Multiple Application Versions Sharing A Database
- Entity Framework Code First from database not adding Key attribute
- How to configure one to many relationship along with inheritance in entityframework
Related Questions in EF-DATABASE-FIRST
- Do Data Annotations only work with ASP.NET?
- Entity Framework “Update model from Database, table becomes relation
- Entity Framework with Sybase SQL Anywhere 16 crashes Visual Studio
- Entity framework loads slowly first time (DB First Model)
- Mapping Stored Procedure Parameters to different Types
- MVVM - Validating the model when a field in the viewmodel is changed
- Entity Framework 6 stored procedures default values
- Pre-generating Entity Framework Views
- Can I generate a .sql update script from an edmx file?
- How to create asp.net MVC database first with stored procedure?
- Database First Entity Framework
- Inheritance and navigation properties to child entities
- ASP .NET entity framework project giving UnintentionalCodeFirstException after being published to azure
- entity framework db first
- How to set custom name of ICollection property in automatically generated POCO entity, using Entity Framework
Related Questions in EF-MODEL-FIRST
- How can i map an existing foreign key to a navigation property with code first
- Need advice regarding handling updating many-to-many relationships in Entity Framework
- How to add navigation property manually model first
- Why does LINQ throw a NotSupportedException?
- 'Add Foreign Key Property to..' checkbox disabled for 0..1 to 1 relationships
- DbContext fails to initialize Model-first database
- Automatic redirect to login page after a certain time
- Validation in Model-first Entity framework application
- Entity Framework Model First: how to create association with properties
- LINQ generates incorrect SQL (reference to a non-existent table)
- Entity Framework - Model First, Many-to-Many Mapping
- ASP.NET Identity: Inheritance with Code First vs. Model First
- Entity Framework Model First and Inheritance
- Forcing EF 6 to create tables with model first
- One Model or Two? - Database First EF 6.0 to SQL Server (2005/2008) needs offline support to SQL Server CE 4.0
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?
Model-first would be the easier solution. You would just create a model from the database and then you will update the database from the model after adding new entities.
You can achieve the same result with code-first too, but with a little extra work. You will need to use EF Migrations to add the new tables to your database. You can read more about EF Migrations here and here.