Manos.Mvc.ModelBinder.ResolveField C# (CSharp) Method

ResolveField() public static method

public static ResolveField ( object model, string key, object &target, PropertyInfo &pi ) : bool
model object
key string
target object
pi System.Reflection.PropertyInfo
return bool
        public static bool ResolveField(object model, string key, out object target, out PropertyInfo pi)
        {
            // For now we just lookup properties directly on the model (no depth search)
            pi = model.GetType().GetProperty(key);
            if (pi!=null)
            {
                target = model;
                return true;
            }

            // Not found
            target = null;
            return false;
        }