Example #1
0
        private Expression MakeColumnExpression(AliasedTableExpression table, IProperty property)
        {
            ITypeMapping typeMapping = default;

            var sourceMapping = relationalTypeMappingSource.FindMapping(property);

            if (!(sourceMapping is null))
            {
                typeMapping
                    = new AdHocTypeMapping(
                          sourceMapping.ClrType,
                          sourceMapping.Converter?.ProviderClrType ?? sourceMapping.ClrType,
                          sourceMapping.DbType,
                          sourceMapping.StoreType,
                          sourceMapping.Converter?.ConvertFromProviderExpression,
                          sourceMapping.Converter?.ConvertToProviderExpression);
            }

            var nullable = GetColumnNullability(property);

            return(new SqlColumnExpression(
                       table,
                       property.Relational().ColumnName,
                       property.ClrType,
                       nullable,
                       typeMapping));
        }
 public ProjectionReferenceRewritingExpressionVisitor(AliasedTableExpression targetTable)
 {
     this.targetTable = targetTable;
 }