none
Getting the column name during runtime in EntityFramework RRS feed

  • Question

  • Is there a way to get the column name information of an EF model during runtime?

    In other words, to accomplish something like this where "CoCity" would actually be the name of the EF column.

    Present:

    var coCity = DbContext.PDFDBXREFs.Where(t => t.KeyNo == KeyNo && t.LOANTYPEID == LoantypeID && t.Active == true&& t.DBFormField == "CoCity").First();

    Possible:

    var coCity = DbContext.PDFDBXREFs.Where(t => t.KeyNo == KeyNo && t.LOANTYPEID == LoantypeID && t.Active == true&& t.DBFormField == EFColumnName).First();


    Bill Yeager

    Wednesday, October 31, 2012 3:34 PM

Answers

  • He does it with LINQ so EF would be similar:

    http://forums.asp.net/t/1642554.aspx/1?how+to+get+column+names+from+linq+datasource+

    Wednesday, October 31, 2012 4:09 PM