public int? SelectedValueAsInt( bool noneAsNull = true ) { if ( string.IsNullOrWhiteSpace( ItemId ) ) { return null; } int result = ItemId.AsInteger(); if ( noneAsNull ) { if ( result == Constants.None.Id ) { return null; } } return result; }