はい、作成したいのですがList<T>
、T はユーザー定義のデータ型、つまり POCO クラス、例えば UserProfile です。
理由: MvcJqGridを使用しており、Json データを作成するための汎用コードを書きたいので、実行時にどのクラス (テーブル) からデータを取得する必要があるかがわかります。
マイコード
public ActionResult TestGrid()
{
string spname = Request.Params["storedprocedurename"]; //spname = UserProfile
// i get this from the post data of MvcJqGrid i.e. user when create a jqgrid, in
// a view defines the table/spname from where data gets loaded in grid.
MyEntities _context = new MYEntities();
List<UserProfile> userProfiles = _context.UserProfiles.ToList<UserProfile>();
// here some code to create a json data and return
}
したがって、この UserProfile はここにハードコーディングされています。Request.params で RoleMaster(eg) を取得した場合、どうすればこれを達成できますか。
構成詳細
entityFramework Version=5.0.0.0 データベース ファーストアプローチ
mvc 4
MvcJqGrid 1.0.9
.net FrameWork 4.5