请查看以下包管理器控制台中提供的数据.我无法进行添加迁移.当我做dotnet.exe崩溃.
PM> Add-Migration 1
Unhandled Exception: System.MissingMethodException: Entry point not found in assembly 'Microsoft.EntityFrameworkCore.Design, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
PM> dotnet --info
.NET Command Line Tools (1.0.0-preview2-003131)
Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Run Code Online (Sandbox Code Playgroud) 下面的代码是我用来填充 Index.cshtml 中的表格的。属性列表有 1 行,地图模型后有 0 行。我错过了什么吗?我预计属性模型也会有 1 行。
// GET://
[HttpGet]
public IActionResult Index()
{
//get
List<Company.Model> list = repo.ReadAll();
//to map
List<Company.DTO> model;
//config for mapping
var config = new MapperConfiguration(cfg => cfg.CreateMap<List<Company.Model>, List<Company.DTO>>());
//create mappper
var mapper = config.CreateMapper();
//the map
model = mapper.Map<List<Company.DTO>>(list);
//return
return View(model);
}
Run Code Online (Sandbox Code Playgroud)
当我做错事时请告诉我!我的第一篇 Automap 和 Stack Overflow 上的第一篇文章。谢谢!!