@@ -14,10 +14,7 @@ public class SampleContext : DbContext
1414{
1515 protected override void OnConfiguring (DbContextOptionsBuilder optionsBuilder )
1616 {
17- // 1. Throw when can not generate a query instead of loading everything into memory
18- optionsBuilder .ThrowOnQueryClientEvaluation ();
19-
20- // 2. Use EntityFrameworkCoreExtensions (add DynamicDataMasking support)
17+ // 1. Use EntityFrameworkCoreExtensions (add DynamicDataMasking support)
2118 optionsBuilder .UseEntityFrameworkCoreExtensions ();
2219
2320 base .OnConfiguring (optionsBuilder );
@@ -27,10 +24,10 @@ public class SampleContext : DbContext
2724 {
2825 base .OnModelCreating (modelBuilder );
2926
30- // 3 . Set Cascade as a default delete behaviour
27+ // 2 . Set Cascade as a default delete behaviour
3128 modelBuilder .OverrideDeleteBehaviour (DeleteBehavior .Cascade );
3229
33- // 4 . Add dynamic data masking (https://docs.microsoft.com/en-us/sql/relational-databases/security/dynamic-data-masking)
30+ // 3 . Add dynamic data masking (https://docs.microsoft.com/en-us/sql/relational-databases/security/dynamic-data-masking)
3431 modelBuilder .Entity <Customer >().Property (t => t .Surname ).HasDataMask (MaskingFunctions .Default ());
3532 modelBuilder .Entity <Customer >().Property (t => t .DiscountCardNumber ).HasDataMask (MaskingFunctions .Random (10 , 100 ));
3633 modelBuilder .Entity <Customer >().Property (t => t .Phone ).HasDataMask (MaskingFunctions .Partial (2 , " XX-XX" , 1 ));
@@ -43,7 +40,7 @@ static void Main(string[] args)
4340{
4441 using (var context = new SampleContext ())
4542 {
46- // 5 . Will not throw when UseInMemoryDatabase is used
43+ // 4 . Will not throw when UseInMemoryDatabase is used
4744 context .Database .MigrateIfSupported ();
4845 }
4946}
0 commit comments