Skip to content

Commit 39ddc96

Browse files
authored
Merge pull request #157 from koenbeuk/full-qualification-not-needed
Full qualification not needed anymore
2 parents 07190c1 + 800546e commit 39ddc96

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

tests/EntityFrameworkCore.Projectables.FunctionalTests/ComplexModelTests.cs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel.DataAnnotations.Schema;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
1+
using System.ComponentModel.DataAnnotations.Schema;
72
using EntityFrameworkCore.Projectables.FunctionalTests.Helpers;
8-
using EntityFrameworkCore.Projectables.Services;
93
using Microsoft.EntityFrameworkCore;
10-
using ScenarioTests;
11-
using VerifyXunit;
12-
using Xunit;
134

145
#nullable disable
156

@@ -27,20 +18,18 @@ public class User
2718

2819
public ICollection<Order> Orders { get; set; }
2920

30-
// todo: since Order is a nested class, we currently have to fully express the location of this class
3121
[Projectable]
32-
public EntityFrameworkCore.Projectables.FunctionalTests.ComplexModelTests.Order LastOrder =>
22+
public Order LastOrder =>
3323
Orders.OrderByDescending(x => x.RecordDate).FirstOrDefault();
3424

35-
// todo: since Order is a nested class, we currently have to fully express the location of this class
3625
[Projectable]
3726
[NotMapped]
38-
public IEnumerable<EntityFrameworkCore.Projectables.FunctionalTests.ComplexModelTests.Order> Last2Orders =>
27+
public IEnumerable<Order> Last2Orders =>
3928
Orders.OrderByDescending(x => x.RecordDate).Take(2);
4029

4130
[Projectable]
42-
public EntityFrameworkCore.Projectables.FunctionalTests.ComplexModelTests.Order GetLastOrderFromExternalDbContext(DbContext dbContext)
43-
=> dbContext.Set<EntityFrameworkCore.Projectables.FunctionalTests.ComplexModelTests.Order>().Where(x => x.UserId == Id).OrderByDescending(x => x.RecordDate).FirstOrDefault();
31+
public Order GetLastOrderFromExternalDbContext(DbContext dbContext)
32+
=> dbContext.Set<Order>().Where(x => x.UserId == Id).OrderByDescending(x => x.RecordDate).FirstOrDefault();
4433

4534
}
4635

0 commit comments

Comments
 (0)