Question: Whats wrong with following code? :(

```
int? parentFolderId = null;
if( this.Request.QueryString ["folderId"] != null )
    parentFolderId = Convert.ToInt32( this.Request.QueryString ["folderId"] );
f = ( from x in this.EntityDataContext.folders
        where x.parent_id == parentFolderId
        select x ).ToList();

```

It returns nothing! Though there ARE records in database with parent\_id as NULL.

However, when I explicitly state NULL; it works!

```
f = ( from x in this.EntityDataContext.folders
        where x.parent_id == null
        select x ).ToList();

```

What could be the issue?

PS: I hate working with mysql using Entity Framework .... every damn simple thing has million issues!

Answer: 
Long Shot

```
f = ( from x in this.EntityDataContext.folders
                where ((parentFolderId!=null && x.parent_id == parentFolderId)
                        ||(parentFolderId==null && x.parent_id == null))
                select x ).ToList();

```

Yeah, this seams wired, and I guess your first example should work just fine with MsSql.
Maybe it's time to file a bug to authors of Linq to MySql ?
This is connector bug and I have reported at mysql.