Entity Framework CoreMedium
🐞 Find the Bug
Read the code carefully and identify the problem.
public async Task<User?> GetUserAsync(int id)
{
var user = _context.Users
.FirstOrDefault(u => u.Id == id);
return user;
}Read the code carefully and identify the problem.
public async Task<User?> GetUserAsync(int id)
{
var user = _context.Users
.FirstOrDefault(u => u.Id == id);
return user;
}