Beispiel #1
0
        private static Tuple <object, Type> CheckModel(object model)
        {
            if (model == null)
            {
                return(Tuple.Create((object)null, (Type)null));
            }
            Type modelType = (model == null) ? typeof(object) : model.GetType();

            bool isAnon = CompilerServicesUtility.IsAnonymousTypeRecursive(modelType);

            if (isAnon ||
                CompilerServicesUtility.IsDynamicType(modelType))
            {
                modelType = null;
                if (isAnon)
                {
                    //model =  DynamicObject.Create(model, Configuration.AllowMissingPropertiesOnDynamic);
                }
            }
            return(Tuple.Create(model, modelType));
        }