私は次のように持ってC# MVC Model
います;
public class MyModel
{
...
public IEnumerable<MyModel> allDetails { get; set; }
public int age { set; get; }
public string gender { set; get; }
public int schoolid { set; get; }
...
}
からデータを取得しますallDetails
。どうすればできますか?
でcontroller
;
model.allDetails = MyDetails.getAllDetails(); // Saves all details in the Model
どうすればこれから取得できますage, gender and school
かmodel
; 私のアプローチは次のとおりです(ただし、機能しません)
model.allDetails.age; // This doesn't work