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 +44
-1
lines changed
Source/LinqToDB.EntityFrameworkCore
LinqToDB.EntityFrameworkCore.BaseTests
LinqToDB.EntityFrameworkCore.PostgreSQL.Tests Expand file tree Collapse file tree 6 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -455,6 +455,10 @@ public virtual void DefineConvertors(
455455 if ( modelType . IsEnum )
456456 continue ;
457457
458+ // skipping arrays
459+ if ( modelType . IsArray )
460+ continue ;
461+
458462 MapEFCoreType ( modelType ) ;
459463 if ( modelType . IsValueType && ! typeof ( Nullable < > ) . IsSameOrParentOf ( modelType ) )
460464 MapEFCoreType ( typeof ( Nullable < > ) . MakeGenericType ( modelType ) ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ internal class TestLogger : ILogger
1313 private static readonly string _newLineWithMessagePadding ;
1414
1515 // ConsoleColor does not have a value to specify the 'Default' color
16+ #pragma warning disable 649
1617 private readonly ConsoleColor ? DefaultConsoleColor ;
18+ #pragma warning restore 649
1719
1820 private readonly string _name ;
1921
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ public class TestUtils
1515
1616 . AddTestLogger ( o =>
1717 {
18- o . IncludeScopes = true ;
1918 o . FormatterName = ConsoleFormatterNames . Simple ;
2019 } ) ;
2120 } ) ;
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . ComponentModel . DataAnnotations ;
3+
4+ namespace LinqToDB . EntityFrameworkCore . PostgreSQL . Tests . Models . NpgSqlEntities
5+ {
6+ public class EntityWithArrays
7+ {
8+ [ Key ]
9+ public int Id { get ; set ; }
10+
11+ public Guid [ ] Guids { get ; set ; } = null ! ;
12+ }
13+ }
Original file line number Diff line number Diff line change @@ -20,9 +20,14 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
2020 entity . HasNoKey ( ) ;
2121 entity . ToView ( "EventsView" , "views" ) ;
2222 } ) ;
23+
24+ modelBuilder . Entity < EntityWithArrays > ( entity =>
25+ {
26+ } ) ;
2327 }
2428
2529 public virtual DbSet < Event > Events { get ; set ; } = null ! ;
30+ public virtual DbSet < EntityWithArrays > EntityWithArrays { get ; set ; } = null ! ;
2631
2732 }
2833}
Original file line number Diff line number Diff line change 11using System ;
22using System . Linq ;
3+ using FluentAssertions ;
34using LinqToDB . Data ;
5+ using LinqToDB . DataProvider . PostgreSQL ;
46using LinqToDB . EntityFrameworkCore . BaseTests ;
57using LinqToDB . EntityFrameworkCore . PostgreSQL . Tests . Models . NpgSqlEntities ;
68using Microsoft . EntityFrameworkCore ;
@@ -67,5 +69,23 @@ public void TestViewMapping()
6769 var l2dbResult = query . ToLinqToDB ( ) . ToArray ( ) ;
6870 }
6971 }
72+
73+ [ Test ]
74+ public void TestArray ( )
75+ {
76+ using ( var db = CreateNpgSqlEntitiesContext ( ) )
77+ {
78+ var guids = new Guid [ ] { Guid . Parse ( "271425b1-ebe8-400d-b71d-a6e47a460ae3" ) ,
79+ Guid . Parse ( "b75de94e-6d7b-4c70-bfa1-f8639a6a5b35" ) } ;
80+
81+ var query =
82+ from m in db . EntityWithArrays . ToLinqToDBTable ( )
83+ where Sql . Ext . PostgreSQL ( ) . Overlaps ( m . Guids , guids )
84+ select m ;
85+
86+ query . Invoking ( q => q . ToArray ( ) ) . Should ( ) . NotThrow ( ) ;
87+ }
88+ }
89+
7090 }
7191}
You can’t perform that action at this time.
0 commit comments