Confirmé
18 novembre 2026Trouve le bug : .NET
Un extrait de code. Trouve le bug, ou prouve qu'il n'y en a pas.
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}Clique sur les lignes qui posent problème.
Ton verdict
Une tentative par jour. La réponse s'affiche juste après.
Garde ta série
Crée un compte pour conserver ta série et suivre ta progression.