Reputation: 18198
How can I list the properties that an entityset has at runtime?
Upvotes: 4
Views: 819
Reputation: 18198
I found the answer link. The answer is
EntitySetBase es = container.BaseEntitySets.OfType<EntitySet>()
.Where( eb=>eb.ElementType.Name ==s).FirstOrDefault();
foreach (EdmMember memberinfo in es.ElementType.Members.Where(m=>m.BuiltInTypeKind == BuiltInTypeKind.EdmProperty) )
Upvotes: 4