// 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; using System.Reflection; namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal { public struct TempDataProperty { private readonly Func _getter; private readonly Action _setter; public TempDataProperty(string tempDataKey, PropertyInfo propertyInfo, Func getter, Action setter) { TempDataKey = tempDataKey; PropertyInfo = propertyInfo; _getter = getter; _setter = setter; } public string TempDataKey { get; } public PropertyInfo PropertyInfo { get; } public object GetValue(object obj) { return _getter(obj); } public void SetValue(object obj, object value) { _setter(obj, value); } } }