Better to stay with LINQ query syntax which is closer to the SQL and you can easily modify your query. Anyway here is your translation:
var query2 = _context.Users
.Where(u => u.Username == username)
.Join(_context.UserRoles, u => u.UserID, ur => ur.UserId, (u,ur) => ur.Role)
.ToArray();
CLICK HERE to find out more related problems solutions.