UpdateModel でキャッチされたエラーの取得
「Id プロパティの設定は、エンティティの逆シリアル化中に .NET 3.5 以降でのみサポートされています」System.Exception {System.NotSupportedException}
public ActionResult Edit1(Guid id, ActivityResponseConsumerMobile arcm) {
if (!ModelState.IsValid) {
SetupDropDowns();
return View(arcm);
}
ActivityResponseConsumerMobile arcmDb = uow.ActivityResponseConsumerMobiles.Single(a => a.Id == id);
try {
UpdateModel(arcmDb);
}
catch {
var x = ModelState;
return View(arcm);
}
質問: MVC2 は UpdateModel() で InvalidOperationException をスローし、id フィールドを更新しようとしています
FormCollection の代わりにオブジェクトを使用しています。私が使用しているORMはLightSpeedです。