internal override void ResolveTopLevelNames()
{
base.ResolveTopLevelNames();
if (BaseType != null)
{
if (!(BaseType is SchemaEntityType))
{
AddError(
ErrorCode.InvalidBaseType, EdmSchemaErrorSeverity.Error,
Strings.InvalidBaseTypeForItemType(BaseType.FQName, FQName));
}
// Since the base type is not null, key must be defined on the base type
else if (_keyElement != null
&& BaseType != null)
{
AddError(
ErrorCode.InvalidKey, EdmSchemaErrorSeverity.Error,
Strings.InvalidKeyKeyDefinedInBaseClass(FQName, BaseType.FQName));
}
}
// If the base type is not null, then the key must be defined on the base entity type, since
// we don't allow entity type without keys.
else if (_keyElement == null)
{
AddError(
ErrorCode.KeyMissingOnEntityType, EdmSchemaErrorSeverity.Error,
Strings.KeyMissingOnEntityType(FQName));
}
else if (null == BaseType
&& null != UnresolvedBaseType)
{
// this is already an error situation, we won't do any resolve name further in this type
return;
}
else
{
_keyElement.ResolveTopLevelNames();
}
}