// 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.AspNet.Mvc.ModelBinding.Validation
{
///
/// Contains data needed for validating a child entry of a model object. See .
///
public struct ValidationEntry
{
///
/// Creates a new .
///
/// The associated with .
/// The model prefix associated with .
/// The model object.
public ValidationEntry(ModelMetadata metadata, string key, object model)
{
if (metadata == null)
{
throw new ArgumentNullException(nameof(metadata));
}
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
Metadata = metadata;
Key = key;
Model = model;
}
///
/// The model prefix associated with .
///
public string Key { get; }
///
/// The associated with .
///
public ModelMetadata Metadata { get; }
///
/// The model object.
///
public object Model { get; }
}
}