我有兩個類對象的數據viewModel。 public class StudentViewModel
{
public PeopleEntity People { get; set; }
public PeopleUnitEntity PeopleUnit { get; set; }
}
在下面的代碼,我得到兩個PeopleEntity和PeopleUnitEntity
項的錯誤,我有一個包含下拉列表,從一臺叫做月取值,在視圖中使用這個局部視圖稱爲PSR 我在控制器傳遞的對象的局部視圖: public ActionResult PSR()
{
var PSRS = _context.PSRs.ToList();
var months = _context.Months.ToList();
var viewModel
通過我想比較和交換值的兩個視圖模型的公共屬性,最理想的是採用這樣的方法: void SwapIfGreater<T>(ref T lhs, ref T rhs) where T : System.IComparable<T>
{
T temp;
if (lhs.CompareTo(rhs) > 0)
{
temp = lhs;
lhs = r
我的模型文件夾中有兩個模型叫做模型,我試圖從模型中拉出數據在視圖中顯示它,我知道只有一個模型語句可以應用於視圖。所以我創建了一個ViewModels,它包含了我想在視圖中引用的屬性。現在,當我運行的應用程序即時得到一個編譯錯誤,它說: 「編譯器錯誤信息:CS0246:類型或命名空間名稱‘模式’找不到(是否缺少using指令或程序集鑑於參考?)」 視圖模型代碼 public class MainMo