我必须在项目中添加新模型 这是模型
public class Marking
{
[Key]
public int IdMakring{get;set;}
public int IdMema { get; set; }
[ForeignKey("Author")]
public string Authorr {get;set;}
}
在我添加的模型memyContext中
public DbSet<Marking> Marking { get; set; }
我做了添加迁移和更新数据库
add-migration initialll -Context MemeGenerator.Data.ApplicationDbContext
add-migration initialll -Context memyContext
update-database -Context MemeGenerator.Data.ApplicationDbContext
当我这样做时,显示错误:
我尝试了更多的更新数据库,但这没有帮助。有人看到我该如何解决?
答案 0 :(得分:0)
尝试执行指定迁移名称
示例:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-secondary">Left</button>
<button type="button" class="btn btn-secondary" id="input-box">
<div class="input-group m-0">
<input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<span class="input-group-text" id="basic-addon2">Zip Zode</span>
</div>
</div>
</button>
<button type="button" class="btn btn-secondary">Right</button>
</div>