Mid-Level
November 18, 2026Spot the bug: .NET
One snippet. Find the bug, or prove there isn't one.
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}Click the lines that carry the problem.
Your verdict
One attempt per day. The answer shows up right after.
Keep your streak
Create an account to keep your streak and track your progress.