src/MVCContrib.UnitTests/PortableAreas/TestingAreaRegistration.cs
/// <summary>
/// Register the received area with the associated context while ignoring potential exception
/// about already registered area.
/// </summary>
Register the received area with the associated context while ignoring potential exception
about already registered area.
Register the received area with the associated context while ignoring potential exception about already registered area .
public static void Register(PortableAreaRegistration areaRegistration, AreaRegistrationContext registrationContext)
        {
            try
            {
                areaRegistration.RegisterArea(registrationContext);
            }
            catch (ArgumentException e)
            {
                if (!e.Message.Contains("An item with the same key has already been added."))
                    throw;
            }
        }
public static void Register ( PortableAreaRegistration areaRegistration , AreaRegistrationContext registrationContext ) { try { areaRegistration . RegisterArea ( registrationContext ) ; } catch ( ArgumentException e ) { if ( ! e . Message . Contains ( " " ) ) throw ; } }
Register the received area with the associated context while ignoring potential exception
about already registered area.
Register the received area with the associated context while ignoring potential exception about already registered area .
areaRegistration
PortableAreaRegistration
registrationContext
AreaRegistrationContext