我正在开发一个asp.net mvc应用程序。我创建了一个视图模型,我想创建一个强类型部分视图,但我收到错误。有谁可以帮助我?这是我的观点模型:
public class AddGISViewModel
{
public HamyarShahr.Models.DomainModels.GIS gis { get; set; }
public IEnumerable<HamyarShahr.Models.DomainModels.Companies> Companies { get; set; }
}
我的控制器:我已创建了一个用于为gis实体创建新信息的操作。
[HttpGet]
public ActionResult Create()
{
AddGISViewModel model = new AddGISViewModel();
CompanyRepository blcompany = new CompanyRepository();
model.Companies = blcompany.Select().ToList();
return View("Create", model: model);
}