Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit e7078cf

Browse files
authored
Merge pull request #140 from linq2db/version3
Release 3.10.1
2 parents f9f9bd3 + f62c96f commit e7078cf

File tree

16 files changed

+113
-22
lines changed

16 files changed

+113
-22
lines changed

Build/linq2db.Default.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>3.10.0</Version>
3+
<Version>3.10.1</Version>
44

55
<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
66
<Product>Linq to DB</Product>

Source/LinqToDB.EntityFrameworkCore/LinqToDBExtensionsAdapter.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,21 @@ public Task<TSource> FirstAsync<TSource>(
8787
=> EntityFrameworkQueryableExtensions.FirstAsync(source, predicate, token);
8888

8989
/// <inheritdoc cref="EntityFrameworkQueryableExtensions.FirstOrDefaultAsync{TSource}(IQueryable{TSource}, CancellationToken)"/>
90-
public Task<TSource> FirstOrDefaultAsync<TSource>(
90+
public Task<TSource?> FirstOrDefaultAsync<TSource>(
9191
IQueryable<TSource> source,
9292
CancellationToken token)
93+
#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type.
9394
=> EntityFrameworkQueryableExtensions.FirstOrDefaultAsync(source, token);
95+
#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type.
9496

9597
/// <inheritdoc cref="EntityFrameworkQueryableExtensions.FirstOrDefaultAsync{TSource}(IQueryable{TSource}, Expression{Func{TSource, bool}}, CancellationToken)"/>
96-
public Task<TSource> FirstOrDefaultAsync<TSource>(
98+
public Task<TSource?> FirstOrDefaultAsync<TSource>(
9799
IQueryable<TSource> source,
98100
Expression<Func<TSource,bool>> predicate,
99101
CancellationToken token)
102+
#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type.
100103
=> EntityFrameworkQueryableExtensions.FirstOrDefaultAsync(source, predicate, token);
104+
#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type.
101105

102106
/// <inheritdoc cref="EntityFrameworkQueryableExtensions.SingleAsync{TSource}(IQueryable{TSource}, CancellationToken)"/>
103107
public Task<TSource> SingleAsync<TSource>(
@@ -113,17 +117,21 @@ public Task<TSource> SingleAsync<TSource>(
113117
=> EntityFrameworkQueryableExtensions.SingleAsync(source, predicate, token);
114118

115119
/// <inheritdoc cref="EntityFrameworkQueryableExtensions.SingleOrDefaultAsync{TSource}(IQueryable{TSource}, CancellationToken)"/>
116-
public Task<TSource> SingleOrDefaultAsync<TSource>(
120+
public Task<TSource?> SingleOrDefaultAsync<TSource>(
117121
IQueryable<TSource> source,
118122
CancellationToken token)
123+
#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type.
119124
=> EntityFrameworkQueryableExtensions.SingleOrDefaultAsync(source, token);
125+
#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type.
120126

121127
/// <inheritdoc cref="EntityFrameworkQueryableExtensions.SingleOrDefaultAsync{TSource}(IQueryable{TSource}, Expression{Func{TSource, bool}}, CancellationToken)"/>
122-
public Task<TSource> SingleOrDefaultAsync<TSource>(
128+
public Task<TSource?> SingleOrDefaultAsync<TSource>(
123129
IQueryable<TSource> source,
124130
Expression<Func<TSource,bool>> predicate,
125131
CancellationToken token)
132+
#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type.
126133
=> EntityFrameworkQueryableExtensions.SingleOrDefaultAsync(source, predicate, token);
134+
#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type.
127135

128136
/// <inheritdoc cref="EntityFrameworkQueryableExtensions.ContainsAsync{TSource}(IQueryable{TSource}, TSource, CancellationToken)"/>
129137
public Task<bool> ContainsAsync<TSource>(

Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFExtensions.Async.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public static Task<TSource> FirstAsyncLinqToDB<TSource>(
7676
=> AsyncExtensions.FirstAsync(source.ToLinqToDB(), predicate, token);
7777

7878
/// <inheritdoc cref="AsyncExtensions.FirstOrDefaultAsync{TSource}(IQueryable{TSource}, CancellationToken)"/>
79-
public static Task<TSource> FirstOrDefaultAsyncLinqToDB<TSource>(
79+
public static Task<TSource?> FirstOrDefaultAsyncLinqToDB<TSource>(
8080
this IQueryable<TSource> source,
8181
CancellationToken token = default)
8282
=> AsyncExtensions.FirstOrDefaultAsync(source.ToLinqToDB(), token);
8383

8484
/// <inheritdoc cref="AsyncExtensions.FirstOrDefaultAsync{TSource}(IQueryable{TSource}, Expression{Func{TSource, bool}}, CancellationToken)"/>
85-
public static Task<TSource> FirstOrDefaultAsyncLinqToDB<TSource>(
85+
public static Task<TSource?> FirstOrDefaultAsyncLinqToDB<TSource>(
8686
this IQueryable<TSource> source,
8787
Expression<Func<TSource,bool>> predicate,
8888
CancellationToken token = default)
@@ -102,13 +102,13 @@ public static Task<TSource> SingleAsyncLinqToDB<TSource>(
102102
=> AsyncExtensions.SingleAsync(source.ToLinqToDB(), predicate, token);
103103

104104
/// <inheritdoc cref="AsyncExtensions.SingleOrDefaultAsync{TSource}(IQueryable{TSource}, CancellationToken)"/>
105-
public static Task<TSource> SingleOrDefaultAsyncLinqToDB<TSource>(
105+
public static Task<TSource?> SingleOrDefaultAsyncLinqToDB<TSource>(
106106
this IQueryable<TSource> source,
107107
CancellationToken token = default)
108108
=> AsyncExtensions.SingleOrDefaultAsync(source.ToLinqToDB(), token);
109109

110110
/// <inheritdoc cref="AsyncExtensions.SingleOrDefaultAsync{TSource}(IQueryable{TSource}, Expression{Func{TSource, bool}}, CancellationToken)"/>
111-
public static Task<TSource> SingleOrDefaultAsyncLinqToDB<TSource>(
111+
public static Task<TSource?> SingleOrDefaultAsyncLinqToDB<TSource>(
112112
this IQueryable<TSource> source,
113113
Expression<Func<TSource,bool>> predicate,
114114
CancellationToken token = default)

Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFTools.ContextExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ public static async Task<BulkCopyRowsCopied> BulkCopyAsync<T>(
233233
[LinqTunnel]
234234
[Pure]
235235
public static IValueInsertable<T> Into<T>(this DbContext context, ITable<T> target)
236+
where T: notnull
236237
{
237238
if (context == null) throw new ArgumentNullException(nameof(context));
238239
if (target == null) throw new ArgumentNullException(nameof(target));

Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFToolsImplDefault.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ protected virtual IDataProvider CreateSqlServerProvider(SqlServerVersion version
331331
{
332332
providerName = "Microsoft.Data.SqlClient";
333333

334-
return DataConnection.GetDataProvider(providerName, connectionString)!;
334+
return DataConnection.GetDataProvider(providerName, connectionString!)!;
335335
}
336336

337337
switch (version)
@@ -364,7 +364,7 @@ protected virtual IDataProvider CreateSqlServerProvider(SqlServerVersion version
364364
protected virtual IDataProvider CreatePostgreSqlProvider(PostgreSQLVersion version, string? connectionString)
365365
{
366366
if (!string.IsNullOrEmpty(connectionString))
367-
return DataConnection.GetDataProvider(ProviderName.PostgreSQL, connectionString)!;
367+
return DataConnection.GetDataProvider(ProviderName.PostgreSQL, connectionString!)!;
368368

369369
string providerName;
370370
switch (version)
@@ -450,6 +450,10 @@ public virtual void DefineConvertors(
450450
if (modelType.IsEnum)
451451
continue;
452452

453+
// skipping arrays
454+
if (modelType.IsArray)
455+
continue;
456+
453457
MapEFCoreType(modelType);
454458
if (modelType.IsValueType && !typeof(Nullable<>).IsSameOrParentOf(modelType))
455459
MapEFCoreType(typeof(Nullable<>).MakeGenericType(modelType));

Source/LinqToDB.EntityFrameworkCore/linq2db.EntityFrameworkCore.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,19 @@
1616
<LangVersion>latest</LangVersion>
1717
</PropertyGroup>
1818

19+
<PropertyGroup Condition="'$(Configuration)'=='Release'">
20+
<DebugType>portable</DebugType>
21+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
22+
<DebugSymbols>true</DebugSymbols>
23+
</PropertyGroup>
24+
1925
<ItemGroup>
2026
<PackageReference Include="linq2db" Version="3.3.0" />
2127
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.11" />
28+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
29+
<PrivateAssets>all</PrivateAssets>
30+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
31+
</PackageReference>
2232
</ItemGroup>
2333

2434
</Project>

Tests/LinqToDB.EntityFrameworkCore.BaseTests/LinqToDB.EntityFrameworkCore.BaseTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="linq2db.Tools" Version="3.2.3" />
13+
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
1314
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.11" />
1415
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.11" />
1516
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.11" />

Tests/LinqToDB.EntityFrameworkCore.BaseTests/Logging/TestLogger.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
}

Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/Models/NpgSqlEntities/NpgSqlEnititesContext.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)