File tree Expand file tree Collapse file tree
tests/EntityFrameworkCore.Projectables.FunctionalTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ;
72using EntityFrameworkCore . Projectables . FunctionalTests . Helpers ;
8- using EntityFrameworkCore . Projectables . Services ;
93using 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
You can’t perform that action at this time.
0 commit comments