我需要从此查询中获取UserCarId(int)并分配给int类型变量。
int UserCarId;
Entities ctx = new Entities();
var query = from enq in ctx.UserCars.Include("aspnet_Users")
where enq.aspnet_Users.UserId == currentUserId
select enq.UserCarId ;
UserCarId = query;
答案 0 :(得分:6)