Browse Source
Use `LastOrDefault` instead of `FirstOrDefault`.
pull/15335/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
2 additions and
2 deletions
-
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContextOptions.cs
-
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbContextOptions.cs
|
|
|
@ -84,7 +84,7 @@ public class AbpDbContextOptions |
|
|
|
var replacementType = dbContextType; |
|
|
|
while (true) |
|
|
|
{ |
|
|
|
var foundType = DbContextReplacements.FirstOrDefault(x => x.Key.Type == replacementType && x.Key.MultiTenancySide.HasFlag(multiTenancySides)); |
|
|
|
var foundType = DbContextReplacements.LastOrDefault(x => x.Key.Type == replacementType && x.Key.MultiTenancySide.HasFlag(multiTenancySides)); |
|
|
|
if (!foundType.Equals(default(KeyValuePair<MultiTenantDbContextType, Type>))) |
|
|
|
{ |
|
|
|
if (foundType.Value == dbContextType) |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ public class AbpMongoDbContextOptions |
|
|
|
var replacementType = dbContextType; |
|
|
|
while (true) |
|
|
|
{ |
|
|
|
var foundType = DbContextReplacements.FirstOrDefault(x => x.Key.Type == replacementType && x.Key.MultiTenancySide.HasFlag(multiTenancySides)); |
|
|
|
var foundType = DbContextReplacements.LastOrDefault(x => x.Key.Type == replacementType && x.Key.MultiTenancySide.HasFlag(multiTenancySides)); |
|
|
|
if (!foundType.Equals(default(KeyValuePair<MultiTenantDbContextType, Type>))) |
|
|
|
{ |
|
|
|
if (foundType.Value == dbContextType) |
|
|
|
|