src/Shared/EntityFramework/Core/SchemaObjectModel/StructuredType.cs
// <summary>
// Add a member to the type
// </summary>
// <param name="newMember"> the member being added </param>
Add a member to the type
Add a member to the type
protected void AddMember(SchemaElement newMember)
        {
            DebugCheck.NotNull(newMember);
            if (string.IsNullOrEmpty(newMember.Name))
            {
                return;
            }
            if (Schema.DataModel != SchemaDataModelOption.ProviderDataModel
                && Utils.CompareNames(newMember.Name, Name) == 0)
            {
                newMember.AddError(
                    ErrorCode.BadProperty, EdmSchemaErrorSeverity.Error,
                    Strings.InvalidMemberNameMatchesTypeName(newMember.Name, FQName));
            }
            NamedMembers.Add(newMember, true, Strings.PropertyNameAlreadyDefinedDuplicate);
        }
protected void AddMember ( SchemaElement newMember ) { DebugCheck . NotNull ( newMember ) ; if ( string . IsNullOrEmpty ( newMember . Name ) ) { return ; } if ( Schema . DataModel != SchemaDataModelOption . ProviderDataModel && Utils . CompareNames ( newMember . Name , Name ) == 0 ) { newMember . AddError ( ErrorCode . BadProperty , EdmSchemaErrorSeverity . Error , Strings . InvalidMemberNameMatchesTypeName ( newMember . Name , FQName ) ) ; } NamedMembers . Add ( newMember , true , Strings . PropertyNameAlreadyDefinedDuplicate ) ; }
Add a member to the type
Add a member to the type
// this is an error condition that has already been reported.
newMember
SchemaElement
the member being added
the member being added