Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Programmatically read the type of a property in a datatype

$
0
0
try following code:
            var dataTypeDescriptor = DynamicTypeManager.GetDataTypeDescriptor(typeof (IPage));
            foreach( var field in dataTypeDescriptor.Fields)
            {
                if (!field.Inherited)
                {
                    OutPut(field.Name + " " + field.InstanceType);

                    if(field.InstanceType == typeof(string))
                    {
                        OutPut("Max length " + field.StoreType.MaximumLength);
                    }
                }
            }

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>