2016-06-09 69 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