How to get the value of EntityKey?
I tried:
String x = Customer.EntityKey.EntityKeyValues[0].Value;
String x = Customer.EntityKey.EntityKeyValues[0].Value.ToString();
String x = Customer.EntityKey.EntityKeyValues;
String x = Customer.EntityKey.EntityKeyValues.ToString();
Ended up with:
Object reference not set to an instance of an object.
Please help. Thanks
As you reported that you’re getting an
Object reference not set to an instance of an object, you might want to check for anullreference;