zzz projects Entity Framework 6 EF 6
Home EF Core Articles Knowledge Base Online Examples
  • Home
  • EF Core
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

19 results in tag: database-migration

Database-first strategy with EF Migrations?

We're using Database first approach with EntityFramework. We've several customers, and when we deploy new product version, we're now applying DB schema changes "manually" with tools like ...SQL Compare.......Is there a way how EF Migrations could help to ...
c# database-migration entity-framework
asked by Shaddix

Reset Entity-Framework Migrations

I've mucked up my migrations, I used ...IgnoreChanges... on the initial migration, but now I want to delete all my migrations and start with an initial migration with all of the logic....When I delete the migrations in the folder and try and ...Add-Migrat...
database-migration ef-migrations entity-framework
asked by Todd

The navigation property 'SenderId' is not a declared property on type 'Conversation'

When I try to do Update-Database, I get this error: ...The navigation property 'SenderId' is not a declared property on type 'Conversation'. Verify that it has not been explicitly excluded from the model and that it is a valid navigation property....Edit....
.net database-migration ef-code-first ef-migrations entity-framework
asked by hyperN

Entity Framework code first migrations throwing error

Here is what I did before I got this error:...Installed EF (the pre release version, 6 maybe, I dunno)...decided I did not want, so uninstalled that and reinstalled the stable version (5)...Truncated my database via SSMS...here is the error:...Exception c...
c#-4.0 database-migration ef-code-first entity-framework
asked by ledgeJumper

MigrateDatabaseToLatestVersion not executed

I can't figure out why my latest migration is not getting executed automatically on application startup (or at least on first access of the database context). I used to run ...update-database... manually in development, but I want to test whether it will ...
asp.net-mvc database-migration ef-code-first entity-framework
asked by Vincent Sels

How to drop a table in Entity Framework Code First?

I am using Entity Framework with Auto Migrations....So when I add a new model to my Context, my database is updated and new table is created....What I want to do is the opposite, droping the table completely from database. However, removing the definition...
c# database-migration ef-code-first ef-migrations entity-framework
asked by emre nevayeshirazi

EF migration shows empty Up() Down() methods

I have a local database that is currently in it's second version and should now go to it's third version....The code for the previous migrations was generated by another programmer so I am assuming I am doing something wrong here....In my model there are ...
c# database-migration entity-framework
asked by user1841243

Database is not getting created at first time

How to re-create the database using EF6?...I have tried both of following post but, i don't know why its not working and getting same error....How do I generate an EF6 database with migrations enabled, without using update-database?...Migrations is enable...
asp.net-mvc database-migration entity-framework-6
asked by Shell

There is already an object named '__MigrationHistory' in the database

When I tried to execute ...SQLQuery... (generated by ...Update-Database -Verbose -f -Script... locally in Visual Studio) on remote database, I see the following error returned by SQL Server Management Studio:...Msg 2714, Level 16, State 6, Line 1...There ...
asp.net-mvc-5 c# database-migration entity-framework nuget
asked by Amirhossein Mehrvarzi

How to prevent data loss when I want to update database by using db-migration?

When I was making update my database by using db-migration, I faced a problem that was ...Automatic migration was not applied because it would result in data loss. ...(I used ...System.ComponentModel.DataAnnotations... such as ...[Required]... and ...[St...
database database-migration entity-framework entity-framework-6
asked by Said Roohullah Allem

How can I change data type of a column in SQL Server?

I am using SQL Server 2008 R2....I want to change the data type of a column (...Size...) from ...decimal... to ...int.... First, I used designer of SQL Server but SQL Server did not allow me to do it. Please attention to the picture....Then I decided to w...
database-migration entity-framework entity-framework-6 sql-server
asked by Said Roohullah Allem

Enable Automatic Migrations in mvc

I am creating a MVC application where I add new classes very often. As the classes are related to each other and the test data in the the tables already created are of no interest I prefer to go with AutomaticMigrations. ...i use the following command to ...
asp.net-mvc database-migration ef-migrations entity-framework
asked by Vini

Database applies ALL previous migrations on update and NOT just the new one

I'm developing a website which, as of current, both has a production and a test database. The production database is hosted externally while the test database is hosted locally....Whenever I make changes to my database I apply the changes through a migrat...
database database-migration ef-migrations entity-framework entity-framework-6
asked by J. Doe

EF migration with new table collation error

I'm using Entity Framework code first, It has been working ok updating the database with db migrations up until recently......I've added a anew property to the AspNetUser table...public partial class AspNetUser { .... public ICollection<Feed> Feeds { get...
azure-sql-database database-migration ef-migrations entity-framework entity-framework-6
asked by raklos

How to recover from Entity Framework nightmare - database already has tables with the same name

How do you get EF back in Sync with code without losing data when Update-database returns the following message...Error Message: System.Data.SqlClient.SqlException (0x80131904): There is already an object named '' in the database.
database-migration ef-migrations entity-framework entity-framework-6
asked by System.Exception

Changing structure of database and moving data in Entity Framework

My Database has entities ...Driver... and ...DriverWork... like this:...Edited:...public class Driver { [Key] public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } } public class DriverWork...
c# database database-migration entity-framework entity-framework-6
asked by 0xaryan

Exception when trying to migrate database in Entity Framework v6.2.0 in Visual Studio v15.8.4

I have setup a database using Entity Framework, code first, every time I try to add a migration or update the database I get the following ...error message...:...PM> update-database Exception calling "CreateInstance" with "7" argument(s): "Constructor on ...
c# database-migration ef-migrations entity-framework entity-framework-6
asked by Alfie

EF6 add migration fails - Access to the path 'C\WINDOWS\SYSTEM32\MyContext.edmx' is denied

I've added new DbSet to my context and tried to run Add-Migration, but it fails with weird error:...Access to the path 'C:\WINDOWS\System32\MyContext.edmx' is denied....Of course, the file does not exist in that directory. What can cause this problem?...T...
c# database-migration ef-migrations entity-framework-6
asked by Krzysztof Skowronek

I want to show relationship with following classes but I got these error

public class Newtask { [Key] public int TId { get; set; } public string Name { get; set; } public int Estimated_days_of_work { get; set; } public virtual ICollection<Enrollment> Enrollments { get; set; } public virtual ICollection<...
asp.net-mvc c# database-migration ef-migrations entity-framework-6
asked by Codelover

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!