src/Shared/EntityFramework/Core/SchemaObjectModel/SchemaEnumType.cs
// <summary>
// Handler for the Member element.
// </summary>
// <param name="reader"> XmlReader positioned on the Member element. </param>
Handler for the Member element.
Handler for the Member element .
private void HandleMemberElement(XmlReader reader)
        {
            DebugCheck.NotNull(reader);
            var enumMember = new SchemaEnumMember(this);
            enumMember.Parse(reader);
            if (!enumMember.Value.HasValue)
            {
                if (_enumMembers.Count == 0)
                {
                    enumMember.Value = 0;
                }
                else
                {
                    var previousValue = (long)_enumMembers[_enumMembers.Count - 1].Value;
                    if (previousValue < long.MaxValue)
                    {
                        enumMember.Value = previousValue + 1;
                    }
                    else
                    {
                        AddError(
                            ErrorCode.CalculatedEnumValueOutOfRange,
                            EdmSchemaErrorSeverity.Error,
                            Strings.CalculatedEnumValueOutOfRange);
                        enumMember.Value = previousValue;
                    }
                }
            }
            _enumMembers.Add(enumMember);
        }
private void HandleMemberElement ( XmlReader reader ) { DebugCheck . NotNull ( reader ) ; var enumMember = new SchemaEnumMember ( this ) ; enumMember . Parse ( reader ) ; if ( ! enumMember . Value . HasValue ) { if ( _enumMembers . Count == 0 ) { enumMember . Value = 0 ; } else { var previousValue = ( long ) _enumMembers [ _enumMembers . Count - 1 ] . Value ; if ( previousValue < long . MaxValue ) { enumMember . Value = previousValue + 1 ; } else { AddError ( ErrorCode . CalculatedEnumValueOutOfRange , EdmSchemaErrorSeverity . Error , Strings . CalculatedEnumValueOutOfRange ) ; enumMember . Value = previousValue ; } } } _enumMembers . Add ( enumMember ) ; }
Handler for the Member element.
Handler for the Member element .
// if the value has not been specified we need to fix it up. // the error has been reported. Assigning previous + 1 would cause an overflow. Null is not really  // expected later on so just assign the previous value. 
reader
XmlReader
XmlReader positioned on the Member element.
XmlReader positioned on the Member element .