// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNet.Mvc.ModelBinding
{
///
/// Contains the result of model binding.
///
public class ModelBindingResult
{
///
/// Creates a new .
///
/// The model which was created by the .
/// The key using which was used to attempt binding the model.
/// A value that represents if the model has been set by the
/// .
public ModelBindingResult(object model, string key, bool isModelSet)
{
Model = model;
Key = key;
IsModelSet = isModelSet;
}
///
/// Gets the model associated with this context.
///
public object Model { get; }
///
///
/// Gets the model name which was used to bind the model.
///
///
/// This property can be used during validation to add model state for a bound model.
///
///
public string Key { get; }
///
///
/// Gets a value indicating whether or not the value has been set.
///
///
/// This property can be used to distinguish between a model binder which does not find a value and
/// the case where a model binder sets the null value.
///
///
public bool IsModelSet { get; }
}
}