【发布时间】:2017-05-28 18:23:08
【问题描述】:
我在模型文件夹中建立了一个名为 XMLbetViewModel 的类,然后我将我拥有的两个表中的一个放置为如下属性:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataLayer;
namespace League2.Models
{
public class XMLbetViewModel
{
public IEnumerable<XML> XMLs {get;set;}
public IEnumerable<Bet> Bets { get; set; }
}
}
然后在“视图”中,我如下调用了该模型:
@model League2.Models.XMLbetViewModel
表名是 XML BET 问题是当我写@model 时,它只是显示表的名称而不是内容。 那么我应该怎么做才能在一个“视图”中同时访问这个模型的内容,因为最后我想把这个信息保存在我的数据库中 我想要做的是:一个视图中有一个表单,其中一些内容(字段)是从 xml 表中读取并填写表单,然后用户填写其他空(内容)字段,然后最后按下一个键,信息保存在投注表中。我有这样的银行:codeFirst,迁移
【问题讨论】:
标签: c# asp.net linq asp.net-mvc-5