Skip to content

Commit

Permalink
Fixed compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdanyliv committed Apr 30, 2021
1 parent 99915a8 commit d5f98aa
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<ItemGroup>
<PackageReference Include="linq2db.Tools" Version="3.2.3" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.11" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.11" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.11" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ internal class TestLogger : ILogger
private static readonly string _newLineWithMessagePadding;

// ConsoleColor does not have a value to specify the 'Default' color
#pragma warning disable 649
private readonly ConsoleColor? DefaultConsoleColor;
#pragma warning restore 649

private readonly string _name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,21 @@ public NpgSqlTests()
_options = optionsBuilder.Options;
}

private NpgSqlEnititesContext CreateNpgSqlExntitiesContext()
private NpgSqlEnititesContext CreateNpgSqlEntitiesContext()
{
var ctx = new NpgSqlEnititesContext(_options);
ctx.Database.EnsureDeleted();
ctx.Database.EnsureCreated();
ctx.Database.ExecuteSqlRaw("create schema \"views\"");
ctx.Database.ExecuteSqlRaw("create view \"views\".\"EventsView\" as select \"Name\" from \"Events\"");
return ctx;
}


[Test]
public void TestFunctionsMapping()
{
using (var db = CreateNpgSqlExntitiesContext())
using (var db = CreateNpgSqlEntitiesContext())
{
var date = DateTime.UtcNow;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Threading.Tasks;

#pragma warning disable 8604
#pragma warning disable CS8625

namespace LinqToDB.EntityFrameworkCore.PostgreSQL.Tests.SampleTests
{
public class Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace LinqToDB.EntityFrameworkCore.SqlServer.Tests
[TestFixture]
public class IssueTests : TestsBase
{
private DbContextOptions<IssueContext>? _options;
private DbContextOptions<IssueContext> _options = null!;
private bool _created;

public IssueTests()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder
.Entity<Patent>()
.HasOne(p => p.Assessment)
.WithOne(pa => pa.Patent)
.WithOne(pa => pa!.Patent)
.HasForeignKey<PatentAssessment>(pa => pa.PatentId)
.OnDelete(DeleteBehavior.Restrict);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public async Task TestSetUpdate([Values(true, false)] bool enableFilter)
{
using (var ctx = CreateContext(enableFilter))
{
var customer = await ctx.Customers.FirstOrDefaultAsync();
var customer = await ctx.Customers.FirstAsync();

var updatable = ctx.Customers.Where(c => c.CustomerId == customer.CustomerId)
.Set(c => c.CompanyName, customer.CompanyName);
Expand Down

0 comments on commit d5f98aa

Please sign in to comment.