Skip to content

Commit

Permalink
fix: query warning
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Sep 8, 2022
1 parent 23e6b0c commit a06afec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GZCTF/ClientApp/src/components/StrengthPasswordInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const requirements = [
{ re: /[0-9]/, label: '包含数字' },
{ re: /[a-z]/, label: '包含小写字母' },
{ re: /[A-Z]/, label: '包含大写字母' },
{ re: /[$&+,:;=?@#|'<>.^*()%!-`]/, label: '包含特殊字符' },
{ re: /[`$&+,:;=?@#|'<>.^*()%!-]/, label: '包含特殊字符' },
]

const getStrength = (password: string) => {
Expand Down
2 changes: 1 addition & 1 deletion GZCTF/ClientApp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default defineConfig(({ mode }) => {
output: {
chunkFileNames: 'static/[hash].js',
assetFileNames: 'static/[hash].[ext]',
entryFileNames: 'static/[name].js',
entryFileNames: 'static/[name].[hash].js',
compact: true,
},
},
Expand Down
8 changes: 5 additions & 3 deletions GZCTF/Repositories/ParticipationRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ public ParticipationRepository(

public async Task<bool> EnsureInstances(Participation part, Game game, CancellationToken token = default)
{
await context.Entry(part).Collection(p => p.Challenges).LoadAsync(token);
await context.Entry(game).Collection(g => g.Challenges).LoadAsync(token);
var challenges = await context.Challenges.Where(c => c.Game == game).ToArrayAsync(token);

// requery instead of Entry
part = await context.Participations.Include(p => p.Challenges).AsSplitQuery().SingleAsync(p => p.Id == part.Id, token);

bool update = false;

foreach (var challenge in game.Challenges)
foreach (var challenge in challenges)
update |= part.Challenges.Add(challenge);

await SaveAsync(token);
Expand Down

0 comments on commit a06afec

Please sign in to comment.