mirror of
https://github.com/zoriya/EntityFrameworkCore.Projectables.git
synced 2026-05-19 17:51:21 +00:00
Fixed code gen issue for Projectable extension methods using other projectable extension methods
This commit is contained in:
+3
@@ -11,6 +11,9 @@ namespace EntityFrameworkCore.Projectables.FunctionalTests.ExtensionMethods
|
||||
[Projectable]
|
||||
public static int Foo(this Entity entity) => entity.Id + 1;
|
||||
|
||||
[Projectable]
|
||||
public static int Foo2(this Entity entity) => entity.Foo() + 1;
|
||||
|
||||
[Projectable]
|
||||
public static Entity? LeadingEntity(this Entity entity, DbContext dbContext)
|
||||
=> dbContext.Set<Entity>().Where(y => y.Id > entity.Id).FirstOrDefault();
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
SELECT ([e].[Id] + 1) + 1
|
||||
FROM [Entity] AS [e]
|
||||
+11
@@ -38,6 +38,17 @@ namespace EntityFrameworkCore.Projectables.FunctionalTests.ExtensionMethods
|
||||
return Verifier.Verify(query.ToQueryString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public Task SelectProjectableExtensionMethod2()
|
||||
{
|
||||
using var dbContext = new SampleDbContext<Entity>();
|
||||
|
||||
var query = dbContext.Set<Entity>()
|
||||
.Select(x => x.Foo2());
|
||||
|
||||
return Verifier.Verify(query.ToQueryString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public Task ExtensionMethodAcceptingDbContext()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user