Beispiel #1
0
 private IDatabaseColumn GetColumn(IModelledColumn column)
 {
     if (column.IsComputed && column is IModelledComputedColumn computedColumn)
     {
         var computedName = Dialect.GetAliasOrDefault(computedColumn.Property !);
         var definition   = computedColumn.Expression.ToSql(Dialect);
         return(new ReflectionTableComputedColumn(Dialect, this, computedName, definition));
     }
     else
     {
         return(new ReflectionTableColumn(Dialect, column.Property !, column.DeclaredDbType, column.IsNullable));
     }
 }
Beispiel #2
0
        public static void Ctor_GivenCollectionWithNullColumns_ThrowsArgumentNullException()
        {
            var testColumns = new IModelledColumn[] { null };

            Assert.That(() => new Key.Foreign <TestTable1>(t => t.PK_TARGET, testColumns), Throws.ArgumentNullException);
        }
Beispiel #3
0
        public static void Ctor_GivenNullColumn_ThrowsArgumentNullException()
        {
            IModelledColumn testColumn = null;

            Assert.That(() => new Key.Foreign <TestTable1>(t => t.PK_TARGET, testColumn), Throws.ArgumentNullException);
        }