// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.AspNetCore.Mvc.Formatters.Xml
{
///
/// The context used by an to wrap or un-wrap types.
///
public class WrapperProviderContext
{
///
/// Initializes a .
///
/// The declared type of the object that needs to be wrapped.
/// if the wrapper provider is invoked during
/// serialization, otherwise .
public WrapperProviderContext(Type declaredType, bool isSerialization)
{
if (declaredType == null)
{
throw new ArgumentNullException(nameof(declaredType));
}
DeclaredType = declaredType;
IsSerialization = isSerialization;
}
///
/// The declared type which could be wrapped/un-wrapped by a different type
/// during serialization or de-serializatoin.
///
public Type DeclaredType { get; }
///
/// if a wrapper provider is invoked during serialization,
/// otherwise.
///
public bool IsSerialization { get; }
}
}