This repository was archived by the owner on Feb 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +40
-2
lines changed
LinqToDB.EntityFrameworkCore.BaseTests
LinqToDB.EntityFrameworkCore.PostgreSQL.Tests Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
33using System . Linq ;
4+ using System . Threading . Tasks ;
45using FluentAssertions ;
56using LinqToDB . Data ;
67using LinqToDB . EntityFrameworkCore . BaseTests . Models . ForMapping ;
@@ -87,5 +88,25 @@ public virtual void TestBulkCopyWithIdentity()
8788 t . Should ( ) . HaveCount ( items . Count ) ;
8889 }
8990
91+ [ Test ]
92+ public virtual async Task TestUIntTable ( )
93+ {
94+ using var context = CreateContext ( ) ;
95+ context . UIntTable . Add ( new UIntTable
96+ {
97+ Field16 = 1 ,
98+ Field16N = 2 ,
99+ Field32 = 3 ,
100+ Field32N = 4 ,
101+ Field64 = 5 ,
102+ Field64N = 6
103+ } ) ;
104+
105+ await context . SaveChangesAsync ( ) ;
106+
107+ ulong field64 = 5 ;
108+ var item = await context . UIntTable . FirstOrDefaultAsyncLinqToDB ( e => e . Field64 == field64 ) ;
109+ }
110+
90111 }
91112}
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ protected ForMappingContextBase(DbContextOptions options) : base(options)
1010
1111 public DbSet < WithIdentity > WithIdentity { get ; set ; } = null ! ;
1212 public DbSet < NoIdentity > NoIdentity { get ; set ; } = null ! ;
13-
13+ public DbSet < UIntTable > UIntTable { get ; set ; } = null ! ;
1414 }
1515}
Original file line number Diff line number Diff line change 1+ using System . ComponentModel . DataAnnotations ;
2+
3+ namespace LinqToDB . EntityFrameworkCore . BaseTests . Models . ForMapping
4+ {
5+ public class UIntTable
6+ {
7+ [ Key ]
8+ public int ID { get ; set ; }
9+
10+ public ushort Field16 { get ; set ; }
11+ public uint Field32 { get ; set ; }
12+ public ulong Field64 { get ; set ; }
13+ public ushort ? Field16N { get ; set ; }
14+ public uint ? Field32N { get ; set ; }
15+ public ulong ? Field64N { get ; set ; }
16+ }
17+ }
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public override ForMappingContextBase CreateContext()
2323 var options = optionsBuilder . Options ;
2424 var ctx = new ForMappingContext ( options ) ;
2525
26- // ctx.Database.EnsureDeleted();
26+ ctx . Database . EnsureDeleted ( ) ;
2727 ctx . Database . EnsureCreated ( ) ;
2828
2929 return ctx ;
You can’t perform that action at this time.
0 commit comments