示例#1
0
        /// <summary>
        /// Adds a column to the key for this subclass, if used
        /// in a table-per-subclass strategy.
        /// </summary>
        /// <param name="column">Column name</param>
        public void KeyColumn(string column)
        {
            KeyMapping key;

            if (attributes.IsSpecified("Key"))
            {
                key = attributes.GetOrDefault <KeyMapping>("Key");
            }
            else
            {
                key = new KeyMapping();
            }

            key.AddColumn(Layer.UserSupplied, new ColumnMapping(column));

            attributes.Set("Key", Layer.UserSupplied, key);
        }
示例#2
0
        /// <summary>
        /// Specify how the foreign key is configured.
        /// </summary>
        /// <param name="keyConfiguration">Configuration <see cref="Action"/></param>
        /// <returns>Builder</returns>
        public void Key(Action <KeyBuilder> keyConfiguration)
        {
            KeyMapping key;

            if (attributes.IsSpecified(x => x.Key))
            {
                key = attributes.Get(x => x.Key);
            }
            else
            {
                key = new KeyMapping();
            }

            keyConfiguration(new KeyBuilder(key));

            attributes.Set(x => x.Key, key);
        }
示例#3
0
        public void KeyColumn(string column)
        {
            KeyMapping key;

            if (joinedSubclassAttributes.IsSpecified(x => x.Key))
            {
                key = joinedSubclassAttributes.Get(x => x.Key);
            }
            else
            {
                key = new KeyMapping();
            }

            key.AddColumn(new ColumnMapping {
                Name = column
            });

            joinedSubclassAttributes.Set(x => x.Key, key);
        }
 public bool IsSpecified(string property)
 {
     return(attributes.IsSpecified(property));
 }
示例#5
0
 public override bool IsSpecified(string attribute)
 {
     return(attributes.IsSpecified(attribute));
 }
 public override bool IsSpecified(string property)
 {
     return attributes.IsSpecified(property);
 }