【发布时间】:2015-02-11 19:29:43
【问题描述】:
我正在尝试填充一个包含部门名称的下拉列表。此下拉列表将位于作为创建新用户的一部分的视图中。我有两个单独的模型如下:
public class User : MongoEntity
{
public User()
{
DepartmentName = new List<Department>();
}
public string FullName { get; set; }
public string LoginName { get; set; }
public string Title { get; set; }
public List<Department> DepartmentName { get; set; }
public string TelephoneNumber { get; set; }
public string Email { get; set; }
}
public class Department : MongoEntity
{
public string DepartmentName { get; set; }
public string DepartmentLocation { get; set; }
}
我无法将部门模型中的值提取到 CreateUser 视图中。
我在这个项目中使用 MongoDB。任何帮助/反馈将不胜感激。
【问题讨论】:
-
有几种方法可以做到这一点。在这里查看我的答案stackoverflow.com/questions/18539149/… 一种方式
-
你能发布你正在使用的试图访问部门的代码吗?
标签: c# asp.net-mvc mongodb asp.net-mvc-5