我已经在c#应用程序中编写了一个linq查询,以获取auth用户所属的应用程序的名称
var authApplicationRepository = AuthApplicationRepository.GetallAsList();
var authUserRepository = AuthUserRepository.GetallAsList();
您认为将这两行结合起来是更好,更短的方法
//Get the name of the application the auth user belongs to
var authUserapplicationid = authUserRepository
.Where(x => x.Id == userChangeRequest.AuthUserId)
.Select(x => x.applicationid)
.FirstOrDefault();
var authUserApplicationName = authApplicationRepository
.Where(x => x.Id == authUserapplicationid)
.Select(x => x.Description)
.FirstOrDefault();