我正在尝试将一个值从我的数据库传递到 asp.net mvc 中的视图,非常简单的东西
public ActionResult SettingsList() {
using (podio_doc_db db = new podio_doc_db() ) {
string app_id = db.Configs.Where(r => r.Key == "app.id").Select(r => r.Value).First();
ViewBag["app_id"] = app_id;
}
return View();
}
但是我不断收到此错误
Cannot apply indexing with [] to an expression of type 'System.Dynamic.DynamicObject'