This repository was archived by the owner on Feb 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +15
-7
lines changed
Source/LinqToDB.EntityFrameworkCore
Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests Expand file tree Collapse file tree 6 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -916,7 +916,7 @@ TransformInfo LocalTransform(Expression e)
916916 break ;
917917 }
918918
919- if ( typeof ( IQueryable < > ) . IsSameOrParentOf ( methodCall . Type ) )
919+ if ( typeof ( IQueryable < > ) . IsSameOrParentOf ( methodCall . Type ) && methodCall . Type . Assembly != typeof ( LinqExtensions ) . Assembly )
920920 {
921921 if ( null == methodCall . Find ( nonEvaluatableParameters ,
922922 ( c , t ) => t . NodeType == ExpressionType . Parameter && c . Contains ( t ) ) )
Original file line number Diff line number Diff line change 11using System . Diagnostics . CodeAnalysis ;
22using System . Linq ;
33using FluentAssertions ;
4+ using LinqToDB . DataProvider . SqlServer ;
45using LinqToDB . EntityFrameworkCore . BaseTests ;
56using LinqToDB . EntityFrameworkCore . SqlServer . Tests . Models . IssueModel ;
67using Microsoft . EntityFrameworkCore ;
@@ -81,5 +82,12 @@ from p in ctx.Patents.Include(p => p.Assessment)
8182 Assert . That ( db . LastQuery , Does . Not . Contain ( "INNER" ) ) ;
8283 }
8384
85+ [ Test ]
86+ public void Issue321Test ( )
87+ {
88+ using var ctx = CreateContext ( ) ;
89+
90+ var _ = ctx . Patents . AsSqlServer ( ) . ToLinqToDB ( ) . ToArray ( ) ;
91+ }
8492 }
8593}
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ public override void Configure(EntityTypeBuilder<Category> builder)
2222 . IsRequired ( )
2323 . HasMaxLength ( 15 ) ;
2424
25- builder . Property ( e => e . Description ) . HasColumnType ( "ntext " ) ;
25+ builder . Property ( e => e . Description ) . HasColumnType ( "nvarchar(max) " ) ;
2626
27- builder . Property ( e => e . Picture ) . HasColumnType ( "image " ) ;
27+ builder . Property ( e => e . Picture ) . HasColumnType ( "varbinary(max) " ) ;
2828 }
2929 }
3030}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public override void Configure(EntityTypeBuilder<CustomerDemographics> builder)
1818 . HasMaxLength ( 10 )
1919 . ValueGeneratedNever ( ) ;
2020
21- builder . Property ( e => e . CustomerDesc ) . HasColumnType ( "ntext " ) ;
21+ builder . Property ( e => e . CustomerDesc ) . HasColumnType ( "nvarchar(max) " ) ;
2222 }
2323 }
2424}
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ public override void Configure(EntityTypeBuilder<Employee> builder)
4343 . IsRequired ( )
4444 . HasMaxLength ( 20 ) ;
4545
46- builder . Property ( e => e . Notes ) . HasColumnType ( "ntext " ) ;
46+ builder . Property ( e => e . Notes ) . HasColumnType ( "nvarchar(max) " ) ;
4747
48- builder . Property ( e => e . Photo ) . HasColumnType ( "image " ) ;
48+ builder . Property ( e => e . Photo ) . HasColumnType ( "varbinary(max) " ) ;
4949
5050 builder . Property ( e => e . PhotoPath ) . HasMaxLength ( 255 ) ;
5151
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public override void Configure(EntityTypeBuilder<Supplier> builder)
3737
3838 builder . Property ( e => e . Fax ) . HasMaxLength ( 24 ) ;
3939
40- builder . Property ( e => e . HomePage ) . HasColumnType ( "ntext " ) ;
40+ builder . Property ( e => e . HomePage ) . HasColumnType ( "nvarchar(max) " ) ;
4141
4242 builder . Property ( e => e . Phone ) . HasMaxLength ( 24 ) ;
4343
You can’t perform that action at this time.
0 commit comments