Linq Convert.ToInt32 in Query

后端 未结 2 1942
天命终不由人
天命终不由人 2021-01-22 04:34

I have some code:

(from AspNetUsers in db.AspNetUsers
join UserDetails in db.UserDetails on new { Id = Convert.ToInt32(AspNetUsers.UserDetailId) } equals new { I         


        
2条回答
  •  情话喂你
    2021-01-22 04:51

    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

提交回复
热议问题