2016-06-09 70 views
0

跑在我的包管理器控制台执行以下操作:启用迁移MVC

Enable-Migrations -ContextTypeName Rent-a-Car-MVC.Models.CarDBContext 

返回:

The context type 'Rent-a-Car-MVC.Models.CarDBContext' was not found in the assembly 'Rent_a_Car_MVC'. 

虽然我有叫Car.cs包含我的项目的模型文件夹中现有的类以下代码:

public class CarDBContext : DbContext 
{ 
    public DbSet<Car> Cars { get; set; } 
} 

笏我做错了吗?

回答

3

输入'enable-migrations',你会看到一个可用的迁移列表

+0

修复了我的问题。 – Barrosy