示例#1
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            var attribute = GetAttribute(instance.EntityType);

            if (attribute == null)
            {
                return;
            }
            instance.Table(attribute.TableName);
            if (!String.IsNullOrEmpty(attribute.Schema))
            {
                instance.Schema(attribute.Schema);
            }
        }
        /// <summary>
        /// Adds Module namespace to schema.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply( IJoinedSubclassInstance instance )
        {
            var namespaces = instance.EntityType.Namespace.Split ( ".".ToCharArray () );

            foreach ( var ns in namespaces )
            {
                if ( ns.Contains ( "Module" ) )
                {
                    instance.Schema ( ns );
                    break;
                }
            }

            var key = instance.EntityType.BaseType.Name + "Key";

            instance.Key.Column ( key );
        }
示例#3
0
        /// <summary>
        /// Adds Module namespace to schema.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IJoinedSubclassInstance instance)
        {
            var namespaces = instance.EntityType.Namespace.Split(".".ToCharArray());

            foreach (var ns in namespaces)
            {
                if (ns.Contains("Module"))
                {
                    instance.Schema(ns);
                    break;
                }
            }

            var key = instance.EntityType.BaseType.Name + "Key";

            instance.Key.Column(key);
        }
示例#4
0
        /// <summary>
        /// Adds Module namespace to schema.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IJoinedSubclassInstance instance)
        {
            var type      = instance.EntityType;
            var schema    = SchemaConvention.GetModuleName(type);
            var tableName = TableNameConvention.GetTableName(type);

            var attr = type.GetAttribute <MapTableAttribute>();
            var key  = instance.EntityType.BaseType.Name;

            key = $"{key}_Id";
            key = attr?.PrimaryKey ?? key;
            key = key.ToLower();
            if (!schema.IsNullOrEmpty())
            {
                instance.Schema(schema);
            }
            instance.Table($"{tableName}");
            instance.Key.Column(key);
        }
示例#5
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Schema(Schema);
     instance.Table(instance.EntityType.Name + ConventionConstants.TableSuffix);
     instance.Key.Column(instance.EntityType.BaseType.Name + ConventionConstants.Id);
 }
示例#6
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Schema(Schema);
     instance.Table(instance.EntityType.Name + ConventionConstants.TableSuffix);
     instance.Key.Column(instance.EntityType.BaseType.Name + ConventionConstants.Id);
 }