示例#1
0
        public static AttributeDescription GetEntityCaptionAttribute(EntityMetadata metadata)
        {
            string[] columnCaptions = new string[] { "Code", "IdNumber", "NumberId", "Number", "Name", "Caption", "Id" };

            int i = -1;
            var properties = metadata.PlainAttributes.Select(pa => pa.PropertyName);
            while (++i < columnCaptions.Count() && !properties.Contains(columnCaptions[i])) { }

            return i < columnCaptions.Count() ? metadata.GetAttributeByPropertyName(columnCaptions[i]) : null;
        }
示例#2
0
        public static AttributeDescription GetEntityCaptionAttribute(EntityMetadata metadata)
        {
            string[] columnCaptions = new string[] { "Code", "IdNumber", "NumberId", "Number", "Name", "Caption", "Id" };

            int i          = -1;
            var properties = metadata.PlainAttributes.Select(pa => pa.PropertyName);

            while (++i < columnCaptions.Count() && !properties.Contains(columnCaptions[i]))
            {
            }

            return(i < columnCaptions.Count() ? metadata.GetAttributeByPropertyName(columnCaptions[i]) : null);
        }