determine which column caused the unique key constraint exception in Entity Framework
<p>I have a table with many values a few of them need to be unique. When I try to insert a row through Entity Framework and if there is a unique key violation, I am catching the exception but am trying to figure out which column caused the exception. Looking at the error message there doesn't seem to be a way to get the name of the column. If I could figure out the name of the column I could give the user a better error message.</p>