News for hackers. Stuff that matters.
Re:A todo list for new ASP.NET Core projects by caleblloyd on Thursday February 08, 2018 @07:28AM (#16331681)
I do not know of a good Cross DB solution. It may be more elegant to check specific exception types for the DBMSs that you do use. For example, MySQL would be:

https://github.com/mysql-net/MySqlConnector/blob/master/src/...

Check that MySqlException.Number == 1062 for Duplicate entry.

Add one check per DBMS that you use.

There are no comments on this comment yet.