asp.net mvc框架中 怎样在一个 View 内传递多个 Model,最好有代码,谢谢
2个回答
展开全部
可以,定义一个大的model,然后该model的某一个属性也是一个Model类型的,如果需要多个实体,那么就把大model的某一个属性定义成一个list<model>或者Iqueryable<model>
public class OrderProcessModel
{
public OrderProcessModel() { }
public long ID { get; set; }
public string OrderId {get;set;}
public string OrderState { get; set; }
public string OrderType { get; set; }
public string UserName { get; set; }
public int? TotalPrice { get; set; }
public string Accepter { get; set; }
public string LockUser { get; set; }
public DateTime AddDate { get; set; }
public IQueryable<Fli_Order_PersonInfo> PersonList { get; set; }
public IQueryable<FlightsInfoModel> FlightList { get; set; }
}
public class OrderProcessModel
{
public OrderProcessModel() { }
public long ID { get; set; }
public string OrderId {get;set;}
public string OrderState { get; set; }
public string OrderType { get; set; }
public string UserName { get; set; }
public int? TotalPrice { get; set; }
public string Accepter { get; set; }
public string LockUser { get; set; }
public DateTime AddDate { get; set; }
public IQueryable<Fli_Order_PersonInfo> PersonList { get; set; }
public IQueryable<FlightsInfoModel> FlightList { get; set; }
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询