I have some code:
(from AspNetUsers in db.AspNetUsers join UserDetails in db.UserDetails on new { Id = Convert.ToInt32(AspNetUsers.UserDetailId) } equals new { I
You can use cast (i.e (int?)AspNetUsers.UserDetailId) instead of Convert and EF providers should implement it (is related to the provider). SQL Server EF provider probably converts it to CAST AS