Avatar of kravindra
kravindra
 asked on

How to read the resultset from LINQ to IEnumerable

              IEnumerable<FundsReceiptBatchDetails> batchIds =
                   (from frBatchids in lstfrbd select new { frBatchids.FundsReceiptBatchID }).Distinct().ToList() as
                   IEnumerable<FundsReceiptBatchDetails>;

I am getting exception like object reference is not set to instance of the object.
.NET Programming

Avatar of undefined
Last Comment
Fernando Soto

8/22/2022 - Mon
Bob Learned

There are a few possibilities.  I am confused, though, why you would create a generics List, and thant convert it back to IEnumerable, which is what form it was in before the ToList call.  I prefer to work with List<FundsReceiptBatchDetails> myself.  
ASKER CERTIFIED SOLUTION
Fernando Soto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Fernando Soto

Hi kravindra; did this work for you?
Your help has saved me hundreds of hours of internet surfing.
fblack61