コード例 #1
0
        private bool HasTypeOverride(AttributeModel attribute)
        {
            var overrideAttributeStereotype = attribute.GetStereotype("EFMappingOptions");

            if (overrideAttributeStereotype != null)
            {
                var columnType = overrideAttributeStereotype.GetProperty <string>("ColumnType");
                if (!string.IsNullOrEmpty(columnType))
                {
                    return(true);
                }
            }

            var overrideTypeStereotype = attribute.Type.Element.GetStereotype("EFMappingOptions");

            if (overrideTypeStereotype != null)
            {
                var columnType = overrideTypeStereotype.GetProperty <string>("ColumnType");
                if (!string.IsNullOrEmpty(columnType))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
        public static TextConstraints GetTextConstraints(this AttributeModel model)
        {
            var stereotype = model.GetStereotype("Text Constraints");

            return(stereotype != null ? new TextConstraints(stereotype) : null);
        }
コード例 #3
0
        public static PrimaryKey GetPrimaryKey(this AttributeModel model)
        {
            var stereotype = model.GetStereotype("Primary Key");

            return(stereotype != null ? new PrimaryKey(stereotype) : null);
        }
コード例 #4
0
        public static Index GetIndex(this AttributeModel model)
        {
            var stereotype = model.GetStereotype("Index");

            return(stereotype != null ? new Index(stereotype) : null);
        }
コード例 #5
0
        public static DefaultConstraint GetDefaultConstraint(this AttributeModel model)
        {
            var stereotype = model.GetStereotype("Default Constraint");

            return(stereotype != null ? new DefaultConstraint(stereotype) : null);
        }
コード例 #6
0
        public static DecimalConstraints GetDecimalConstraints(this AttributeModel model)
        {
            var stereotype = model.GetStereotype("Decimal Constraints");

            return(stereotype != null ? new DecimalConstraints(stereotype) : null);
        }