Inheritance: System.Attribute
        private static AbstractDatalist GetModelFromExpression <TModel, TProperty>(Expression <Func <TModel, TProperty> > expression)
        {
            MemberExpression member   = expression.Body as MemberExpression;
            PropertyInfo     propInfo = member.Member as PropertyInfo;

            DatalistAttribute attr = propInfo.GetCustomAttribute <DatalistAttribute>();

            if (attr == null)
            {
                throw new DatalistException(String.Format("Property {0} does not have DatalistAttribute specified", propInfo.Name));
            }

            return((AbstractDatalist)Activator.CreateInstance(attr.Type));
        }
        private static AbstractDatalist GetModelFromExpression <TModel, TProperty>(Expression <Func <TModel, TProperty> > expression)
        {
            MemberExpression  exp      = expression.Body as MemberExpression;
            DatalistAttribute datalist = exp.Member.GetCustomAttribute <DatalistAttribute>();

            if (datalist == null)
            {
                throw new DatalistException(
                          String.Format(
                              "'{0}' property does not have a '{1}' specified.",
                              exp.Member.Name, typeof(DatalistAttribute).Name));
            }

            return((AbstractDatalist)Activator.CreateInstance(datalist.Type));
        }