TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pankaj Sharma
NA
40
3.4k
Migration Exception Unhandled in Entity Framework
May 14 2016 12:45 PM
I am working of Entity Framework code First approach i am new to Entity Framework..
Today i was working of configure entity mapping using the Fluent API. I was trying to change the schema of database using below code ..
Code of My Employee_Context class is
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entity2
{
class EmployeeContext:DbContext
{
public EmployeeContext() : base("name=Emp_Connect")
{
Database.SetInitializer(new MigrateDatabaseToLatestVersion<EmployeeContext, Entity2.Migrations.Configuration>("Emp_Connect"));
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
//Configure Domain Classes Here
modelBuilder.HasDefaultSchema("Admin");
}
public virtual DbSet<Employee> Employees { get; set; }
public virtual DbSet<Project> Projects { get; set; }
}
}
When i run the program then i got following error..
Automatic migrations that affect the location of the migrations history system table (such as default schema changes) are not supported. Please use code-based migrations for operations that affect the location of the migrations history system table.
I don't know how to solve this Please help me....
Reply
Answers (
1
)
tabcontrol listview
Methods in C# and function in c