I'm using EF code first, my models look like this:
public class Warehouse
{
public int Id { get; set; }
public ICollection<Item> Items { get; set; }
public ICollection<Branch> Branches { get; set; }
}
Apparently the scaffolded view doesn't support such scenarios; how can I add Items
and Branches
in Warehouse/Create page? Here is the scaffolded View:
@model WarehouseManagementMVC.Models.Warehouse
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Warehouse</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}