Esempio n. 1
0
        /// <summary>
        /// Returns true if the given class represents a database table with an identity primary key column, false otherwise
        /// Default: True if the property representing the primary key is an integer property, false otherwise
        /// </summary>
        /// <param name="entityType">The type for which is should be determined if the underlying database table has an identity primary key column</param>
        /// <returns>True if the given class represents a database table with an identity primary key column, false otherwise</returns>
        public virtual bool HasIdentityId(Type entityType)
        {
            var dataReader = new ConventionReader(this);
            var idProperty = dataReader.TryGetIdProperty(entityType);

            return idProperty != null && idProperty.PropertyType == typeof(int);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns true if the given class represents a database table with an identity primary key column, false otherwise
        /// Default: True if the property representing the primary key is an integer property, false otherwise
        /// </summary>
        /// <param name="entityType">The type for which is should be determined if the underlying database table has an identity primary key column</param>
        /// <returns>True if the given class represents a database table with an identity primary key column, false otherwise</returns>
        public virtual bool HasIdentityId(Type entityType)
        {
            var dataReader = new ConventionReader(this);
            var idProperty = dataReader.TryGetIdProperty(entityType);

            return(idProperty != null && idProperty.PropertyType == typeof(int));
        }
Esempio n. 3
0
        public void SetUp()
        {
            var convention = new TestingConvention();

            _reader = new ConventionReader(convention);
        }
 public void SetUp()
 {
     var convention = new TestingConvention();
     _reader = new ConventionReader(convention);
 }