locked
cant get value rusults from query RRS feed

  • Question

  • User-323149085 posted

    I need to get a list of Id's by querying a query im not getting any error just not getting the value I need and im getting "System.Collections.Generic.List […] or Count results
    what I have tried so far :

    IQueryable<QuettaQuettaOfferViewModel> viewModel =
                _context.Quetta.Include(q => q.Category.CatName).Where(sd => sd.SiteUserId == userId)
                    //Properties 
                    .GroupJoin(_context.QuettaOffers.OrderBy(p => p.OfferPrice),
                        Quetta => Quetta.Id,
                        offer => offer.QuettaReqId, (quetta, joinedOffersQuetta) => new QuettaQuettaOfferViewModel
                        {
                            //Properties 
    
                            QuettaOfferViewModel = joinedOffersQuetta.Select(o => new RequestOfferVM
                            {
                                //Properties 
                            }).ToList()
                        }); //Results OK     
    
            IQueryable<int>
    //Im trying on each one of the Querys mark as ttt ,ttt1 ,ttt3 to get the ID list > 
                ttt1 = viewModel.Select(a => a.Id).ToList().AsQueryable(); //Results =System.Collections.Generic.List
    //Results Should be (8,11) var ttt2 = viewModel.Select(a => a.Id).AsEnumerable().ToList(); //Results=count=2 List<int> ttt3 = viewModel.Select(a => a.Id).AsEnumerable().ToList(); //Results=count=2 var ttt = viewModel.Select(a => a.Id).Distinct().ToList(); //Results=count=2 ViewBag.SellerAnswers = _context.SellerAns.Where(u => u.QuoteId.Equals(ttt)).ToList(); // && u.SellerAnswer.Length>0); return View(viewModel); }

    Thanks 

    Monday, November 19, 2018 12:21 PM

Answers

All replies