Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more json tests #35593

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Text.Json;

namespace Microsoft.EntityFrameworkCore.Query;

#nullable disable

public abstract class AdHocJsonQueryRelationalTestBase : AdHocJsonQueryTestBase
{
protected TestSqlLoggerFactory TestSqlLoggerFactory
=> (TestSqlLoggerFactory)ListLoggerFactory;

protected virtual string JsonColumnType
=> null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{
var contextFactory = await InitializeAsync<DbContext>(
onConfiguring: b => b.ConfigureWarnings(ConfigureWarnings),
onModelCreating: b => b.Entity<Pub32310>().OwnsOne(e => e.Visits).ToJson().HasColumnType(JsonColumnType),

Check failure on line 27 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build Linux)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L27

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(27,79): error CS1061: (NETCORE_ENGINEERING_TELEMETRY=Build) 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.Pub32310, AdHocJsonQueryTestBase.Visits32310>' does not contain a definition for 'ToJson' and no accessible extension method 'ToJson' accepting a first argument of type 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.Pub32310, AdHocJsonQueryTestBase.Visits32310>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 27 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build Linux)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L27

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(27,102): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'JsonColumnType' does not exist in the current context

Check failure on line 27 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build macOS)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L27

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(27,79): error CS1061: (NETCORE_ENGINEERING_TELEMETRY=Build) 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.Pub32310, AdHocJsonQueryTestBase.Visits32310>' does not contain a definition for 'ToJson' and no accessible extension method 'ToJson' accepting a first argument of type 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.Pub32310, AdHocJsonQueryTestBase.Visits32310>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 27 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build macOS)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L27

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(27,102): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'JsonColumnType' does not exist in the current context
seed: Seed32310);

await using var context = contextFactory.CreateContext();
Expand All @@ -44,7 +44,8 @@
{
var user = new Pub32310
{
Name = "FBI", Visits = new Visits32310 { LocationTag = "tag", DaysVisited = [new DateOnly(2023, 1, 1)] }
Name = "FBI",
Visits = new Visits32310 { LocationTag = "tag", DaysVisited = [new DateOnly(2023, 1, 1)] }
};

context.Add(user);
Expand Down Expand Up @@ -119,9 +120,9 @@
=> modelBuilder.Entity<MyEntity29219>(
b =>
{
b.ToTable("Entities");

Check failure on line 123 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build Linux)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L123

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(123,19): error CS1061: (NETCORE_ENGINEERING_TELEMETRY=Build) 'EntityTypeBuilder<AdHocJsonQueryTestBase.MyEntity29219>' does not contain a definition for 'ToTable' and no accessible extension method 'ToTable' accepting a first argument of type 'EntityTypeBuilder<AdHocJsonQueryTestBase.MyEntity29219>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 123 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build macOS)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L123

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(123,19): error CS1061: (NETCORE_ENGINEERING_TELEMETRY=Build) 'EntityTypeBuilder<AdHocJsonQueryTestBase.MyEntity29219>' does not contain a definition for 'ToTable' and no accessible extension method 'ToTable' accepting a first argument of type 'EntityTypeBuilder<AdHocJsonQueryTestBase.MyEntity29219>' could be found (are you missing a using directive or an assembly reference?)
b.Property(x => x.Id).ValueGeneratedNever();
b.OwnsOne(x => x.Reference).ToJson().HasColumnType(JsonColumnType);

Check failure on line 125 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build Linux)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L125

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(125,45): error CS1061: (NETCORE_ENGINEERING_TELEMETRY=Build) 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.MyEntity29219, AdHocJsonQueryTestBase.MyJsonEntity29219>' does not contain a definition for 'ToJson' and no accessible extension method 'ToJson' accepting a first argument of type 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.MyEntity29219, AdHocJsonQueryTestBase.MyJsonEntity29219>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 125 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build Linux)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L125

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(125,68): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'JsonColumnType' does not exist in the current context

Check failure on line 125 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build macOS)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L125

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(125,45): error CS1061: (NETCORE_ENGINEERING_TELEMETRY=Build) 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.MyEntity29219, AdHocJsonQueryTestBase.MyJsonEntity29219>' does not contain a definition for 'ToJson' and no accessible extension method 'ToJson' accepting a first argument of type 'OwnedNavigationBuilder<AdHocJsonQueryTestBase.MyEntity29219, AdHocJsonQueryTestBase.MyJsonEntity29219>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 125 in test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build macOS)

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs#L125

test/EFCore.Specification.Tests/Query/AdHocJsonQueryTestBase.cs(125,68): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'JsonColumnType' does not exist in the current context
b.OwnsMany(x => x.Collection).ToJson().HasColumnType(JsonColumnType);
});

Expand Down Expand Up @@ -1423,7 +1424,6 @@
var result = async
? await query.ToListAsync()
: query.ToList();

Assert.Equal(2, result.Count);
}
}
Expand Down Expand Up @@ -1467,9 +1467,9 @@

#endregion

protected TestSqlLoggerFactory TestSqlLoggerFactory
=> (TestSqlLoggerFactory)ListLoggerFactory;
//protected TestSqlLoggerFactory TestSqlLoggerFactory
// => (TestSqlLoggerFactory)ListLoggerFactory;

protected virtual string JsonColumnType
=> null;
//protected virtual string JsonColumnType
// => null;
}
Loading