locked
remove a few items (Id) from results RRS feed

  • Question

  • User-323149085 posted

    Hello ,

    im trying to remove a few items from a query results using linqCore but its not removing them

    code& results :

    IQueryable<int> postOn = //Results=9(Id)OK 
                            _context.QuettaOffers.Where(d => d.SiteUserId == LoguserId).Select(s => s.QuettaReqId);
    
                        //Get all request that relevant to user without the one he already post on 
                        IOrderedEnumerable<QuettaReq> listOfR = //Results= 9,11 (Id) should be ..11(Id)
                            //IQueryable<QuettaReq> listOfR
                            _context.Quetta.Include(q => q.Category)
                                .Where(d => d.OfferDate > DateTime.Now && d.CatId == suplayerCat)
                                .ToList()
                                //.ToList()
                                .SkipWhile(a => a.Id.Equals(postOn))
                                .OrderBy(x => x.Id);
                        //  .TakeWhile(a => a.Id != postOn);

    Thanks in advance 

    Wednesday, August 29, 2018 8:14 AM

Answers

  • User-323149085 posted

    Get it

     var listOfR =
                                _context.Quetta.Include(q => q.Category)
                                    .Where(d => d.OfferDate > DateTime.Now && d.CatId == suplayerCat)
                                    .Where(rq => !postOn.Contains(rq.Id));

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 29, 2018 1:01 PM