Entity framework - beware of duplicate records
One thing I learnt while using entity framework is to always have a unique column in your select statement. Specially when you are using views in LINQ queries. Else you will end up having duplicate record for some weird reason.
Though your count will be the expected count of results, but there will be duplicate rows instead of uniques.
I ended up in a big mess because of this, I had to send an emailer where I used LINQ to fetch my record from SQL Sever View. I just had two columns in there - name,email - no unique ID!! There were duplicate records because of which some people got same mail 100 times!!!!!!!!!!!!!!!!!!!!!!.
So Beware!!!
Written by Neelam Gupta
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#