Hi
I have below code & i want that if there is more than 1 record it should give message
TicketAnalysi objUpload = context.TicketAnalysis.Single(rec => rec.TicketID == Convert.ToInt32(hdfTicketId.Value));
Thanks
Hi
I have below code & i want that if there is more than 1 record it should give message
TicketAnalysi objUpload = context.TicketAnalysis.Single(rec => rec.TicketID == Convert.ToInt32(hdfTicketId.Value));
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Aravind GovindarajPosted Dec 6, 2022, 11:03 AM
Please find the code
var moreThanOneRecordExists = context.TicketAnalysis.Where(rec => rec.TicketID == Convert.ToInt32(hdfTicketId.Value)).Skip(1).Any();
Vishal JoshiPosted Dec 6, 2022, 1:03 PM
Hello
You can check count. please try below code.
Thank you