Seshu B

Seshu B

  • NA
  • 442
  • 145k

How to pass table name dynamically in entity framework mvc5

Jun 5 2017 5:37 AM
Hi all
i want to pass tablename as dynamically to get column names list in mvc5
 
i have tried like this
 
public List<string> GetColumnNames(string tablename)
{
using (var Context = new MCPEntities())
{
var names = typeof(AdministratorInformation).GetProperties().Select(property => property.Name).ToArray();
return names.ToList();

}

Answers (1)