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

Entity Framework Core - Knowledge Base (KB)

223 results for: in tag: ef-migrations

Can't update database using EF Migrations after updating to EF 6.0.0-alpha

After updating my Entity Framework to version 6.0.0-alpha1 I cant update database. This is the error I'm getting:...PM> update-database -verbose Using StartUp project 'DataCenter'. Using NuGet project 'DataCenter.Domain'. Specify the '-Verbose' flag to vi...
code-first ef-migrations entity-framework entity-framework-6
asked by Mahmoodvcs

What is the correct use of IDatabaseInitializer in EF?

I have a custom DatabaseInitialiser which is below.../// <summary> /// Implements the IDatabaseInitializer to provide a custom database initialisation for the context. /// </summary> /// <typeparam name="TContext">TContext is the DbContext</typeparam> pub...
c# ef-code-first ef-migrations entity-framework entity-framework-6
asked by ashutosh raina

EF6, Code-First, enable-migrations, "Unable to load the specified metadata resource"

I have created a C# class library with 3 entity classes and a DbContext for code-first generation of database. All has gone well with version 1. I have created a separate test library and the class library with the DbContext class has been behaving as e...
code-first ef-migrations entity-framework entity-framework-6
asked by Neil W

How to register a custom EF Code First migration operation for scaffolding?

I have ...class SetIdentitySeedOperation: MigrationOperation..., which sets the identity value for the specified table. To wire it up, I use a custom ...SqlServerMigrationSqlGenerator..., so if I manually write ....AddOperation(new SetIdentitySeedOperatio...
.net c# ef-migrations entity-framework entity-framework-6
asked by chase

Unable to find the requested .Net Framework Data Provider. It may not be installed

This morning I suddenly got this exception when trying to add a custom migration step to our EF Code-first migrations:...The ADO.NET provider with invariant name '.NET Framework Data Provider for SQL Server' is either not registered in the machine or appl...
ef-code-first ef-migrations entity-framework entity-framework-6
asked by Jesper Lund Stocholm

Entity framework code first migration to multiple database

Lets say we have the architecture model of web application where we have 1 database per 1 account. Database structure is the same for these accounts and differs only on data with in. How can i configurate a migrations in code first model.
code-first ef-code-first ef-migrations entity-framework entity-framework-6
asked by Vitach

Set identity to the previous created column during migration

I have a project with the CodeFirst database (Entity Framework 6) and two migration steps. Database is updated automatically by using this code in Application_Start in Global.asax:...Database.SetInitializer( new MigrateDatabaseToLatestVersion<My...
ef-code-first ef-migrations entity-framework entity-framework-6
asked by Starina

How to edit previously applied migration without adding another migration in EF code first

I have an applied migration using "haward" db schema....public partial class CreateCourseCategoryTable : DbMigration { public override void Up() { CreateTable( "haward.CourseCategories", c =>...
ef-code-first ef-migrations entity-framework entity-framework-6
asked by Jaime Sangcap

Entity Framework multiple projects with code first migrations

I have a class library project named "Core" which defines CoreContext with properties for common classes:...public class CoreContext : DbContext { public DbSet<User> Users { get; set; } public DbSet<Role> Roles { get; set; } public DbSet<UserC...
c# ef-migrations entity-framework entity-framework-6
asked by Yavor Dimitrov

Error when running Seed method using code first EF 6

I was trying to run the update-database command to insert some initial data in my database and I got and error. Here is my class:...[Table("NotAllowedDomain")] public class NotAllowedDomain : Entity { [Key] public int DomainId { get; set; } p...
ef-code-first ef-migrations entity-framework entity-framework-6
asked by ddieppa

How to set the isolation level for Entity Framework CodeFirst Migrations

If you run an entity framework migration (either automatic or explicit) against tables published for SQL Server replication you get the following error: ...You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels....
c# ef-migrations entity-framework entity-framework-6 sql-server
asked by Paul-Jan

Entity Framework bug? "Context changed" Error, even when not

I have gotten myself into an odd Groundhog Day scenario with an MVC application of mine.... Unless I apply my workaround (Later in this question) each time I debug the application I'm presented with this error:...The model backing the 'UsersContext' conte...
asp.net-mvc asp.net-mvc-4 ef-migrations entity-framework entity-framework-6
asked by Mike

error loading database initializer with EF6

I have been trying to follow this tutorial ... ...http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application... but I keep getting the following error ... ...system.invalidoper...
asp.net-mvc c# ef-migrations entity-framework entity-framework-6
asked by Kevin Donde

Entity Framework 6 Code First migrations - multiple branches for production

In my project we have a branch model that has a separate development branch and has a separate branch for each release. It may look like this:...dev ______ ______ / \ / \ master --+---+----+---+---+----+----+--- (..
ef-code-first ef-migrations entity-framework entity-framework-6
asked by pinus.acer

There is already an object named in the database

Update-Database failed from Package Manager Console. I've used Entity Framework 6.x and code-first approach. Error is..."There is already an object named 'AboutUs' in the database."...How can I solve this problem?...internal sealed class Configuration ...
database ef-code-first ef-migrations entity-framework entity-framework-6
asked by Said Roohullah Allem

How to make Package Manager Console in VS2013 available (not disabled)?

Currently, when I open Package Manager Console in VS2013 it is unavailable (all controls are in disabled state). I want to preform migrations in EF7. (EntityFramework.Commands packages from EF7 is installed in the project.)...I am not sure, why it is no l...
.net ef-migrations entity-framework-core nuget visual-studio-2013
asked by TN.

Entity Framework 6: How to override SQL generator?

I'd like to amend the SQL that's being generated by EF:CF when generating the database schema (DDL), as ...suggested by the Entity Framework team.......How can this be done?...I couldn't find anything appropriate via Google.
ef-code-first ef-migrations entity-framework entity-framework-6 sql-generation
asked by AxD

Scaffold migration with context key change

I have restructured my project which led to a change of namespace name of the database context and associated Code First configuration. At that point, I've had one scaffolded migration, "InitialCreate" and thus my database's ...__MigrationHistory... table...
c# ef-code-first ef-migrations entity-framework entity-framework-6
asked by Tomáš Hübelbauer

How to programatically create Sql Azure database of type Basic/Standard edition through Enity Framework code first

I use EF 6. My existing code is : ...public void CreateOrUpdateCompanyDb(string companyDbName) { try { string connectionString = _connectionStringProvider.GetConnectionString(companyDbName); DbMigrationsConfiguratio...
azure-sql-database ef-code-first ef-migrations entity-framework entity-framework-6
asked by Ognyan Dimitrov

Entity Framework 6.1 Code First migration error: EntityType 'IdentityUserRole' has no key defined

I created a new MVC 5 project and I tried to enable migrations for the Code First entities I've been creating, when I got the following PS exceptions in the Package Manager Console:...One or more validation errors were detected during model generation: P...
c# ef-code-first ef-migrations entity-framework entity-framework-6
asked by joe_coolish

Page 1 of 12
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • …
  • »
  • »»

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