vendredi 22 avril 2016

How to catch Entity framework DbUpdateException: SqliteErrorCode?

Is there a way to catch SqliteErrorCode from the exception?

((Microsoft.Data.Sqlite.SqliteException)ex.InnerException).SqliteErrorCode 19

Solution offered here by another question as casting exception to a SqlException doesn't work?

One solution could be to check if the Message contains certain string, but is there a way to do it by the error code?

Aucun commentaire:

Enregistrer un commentaire