-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression tests for #13381 - NullReferenceException when materializi…
…ng a Query type on the right side of a left join Issue has been fixed in earlier checkin. Resolves #13381
- Loading branch information
Showing
15 changed files
with
120 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 36 additions & 3 deletions
39
test/EFCore.Specification.Tests/TestModels/Northwind/CustomerQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,45 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.Northwind | ||
{ | ||
public class CustomerQuery | ||
{ | ||
public string CompanyName { get; set; } | ||
public int OrderCount { get; set; } | ||
public string SearchTerm { get; set; } | ||
public string ContactName { get; set; } | ||
public string ContactTitle { get; set; } | ||
public string Address { get; set; } | ||
public string City { get; set; } | ||
|
||
[NotMapped] | ||
public bool IsLondon => City == "London"; | ||
|
||
protected bool Equals(CustomerQuery other) | ||
=> string.Equals(CompanyName, other.CompanyName); | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (obj is null) | ||
{ | ||
return false; | ||
} | ||
|
||
return ReferenceEquals(this, obj) | ||
? true | ||
: obj.GetType() == GetType() | ||
&& Equals((CustomerQuery)obj); | ||
} | ||
|
||
public static bool operator ==(CustomerQuery left, CustomerQuery right) | ||
=> Equals(left, right); | ||
|
||
public static bool operator !=(CustomerQuery left, CustomerQuery right) | ||
=> !Equals(left, right); | ||
|
||
public override int GetHashCode() | ||
// ReSharper disable once NonReadonlyMemberInGetHashCode | ||
=> CompanyName?.GetHashCode() ?? 0; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
test/EFCore.Specification.Tests/TestModels/Northwind/CustomerQueryWithQueryFilter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.Northwind | ||
{ | ||
public class CustomerQueryWithQueryFilter | ||
{ | ||
public string CompanyName { get; set; } | ||
public int OrderCount { get; set; } | ||
public string SearchTerm { get; set; } | ||
} | ||
} |
48 changes: 0 additions & 48 deletions
48
test/EFCore.Specification.Tests/TestModels/Northwind/CustomerView.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
test/EFCore.Specification.Tests/TestModels/Northwind/ProductView.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.Northwind | ||
{ | ||
public class ProductView | ||
{ | ||
public int ProductID { get; set; } | ||
public string ProductName { get; set; } | ||
public string CategoryName { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters