Medior
18 november 2026Vind de bug: .NET
Eén stukje code. Vind de bug, of bewijs dat er geen is.
csharp
1using Microsoft.EntityFrameworkCore;
2
3public class UserService
4{
5 private readonly AppDbContext _db;
6
7 public UserService(AppDbContext db)
8 {
9 _db = db;
10 }
11
12 public async Task<User?> FindByEmailAsync(string email)
13 {
14 if (string.IsNullOrWhiteSpace(email))
15 return null;
16
17 return await _db.Users
18 .AsNoTracking()
19 .FirstOrDefaultAsync(u => u.Email == email);
20 }
21}Klik op de regels die het probleem veroorzaken.
Jouw oordeel
Eén poging per dag. Het antwoord verschijnt direct daarna.
Behoud je reeks
Maak een account om je reeks te behouden en je voortgang te volgen.