I was using EF4 and a piece of code I found to get the MaxLength value from an entity like this:
public static int? GetMaxLength(string entityTy
I had similar issue and solution is here;
MyDBEntities ctx = new MyDBEntities();
var objectContext = ((IObjectContextAdapter)ctx).ObjectContext;
var cols = from meta in objectContext.MetadataWorkspace.GetItems(DataSpace.CSpace)
.Where(m => m.BuiltInTypeKind == BuiltInTypeKind.EntityType)
from p in (meta as EntityType).Properties
.Where(p => p.DeclaringType.Name == "TableName")
select new
{
PropertyName = p.Name
};