Esempio n. 1
0
 /// <summary>
 /// Adds the entity framework integration.
 /// </summary>
 /// <param name="sentryOptions">The sentry options.</param>
 /// <returns></returns>
 public static SentryOptions AddEntityFramework(this SentryOptions sentryOptions)
 {
     sentryOptions.AddExceptionProcessor(new DbEntityValidationExceptionProcessor());
     // DbConcurrencyExceptionProcessor is untested due to problems with testing it, so it might not be production ready
     //sentryOptions.AddExceptionProcessor(new DbConcurrencyExceptionProcessor());
     return(sentryOptions);
 }
Esempio n. 2
0
        /// <summary>
        /// Adds the entity framework integration.
        /// </summary>
        /// <param name="sentryOptions">The sentry options.</param>
        /// <returns></returns>
        public static SentryOptions AddEntityFramework(this SentryOptions sentryOptions)
        {
            try
            {
#pragma warning disable 618 // TODO: We can make the method internal on a new major release.
                SentryDatabaseLogging.UseBreadcrumbs(diagnosticLogger: sentryOptions.DiagnosticLogger);
#pragma warning restore 618
            }
            catch (Exception e)
            {
                sentryOptions.DiagnosticLogger?
                .LogError("Failed to configure EF breadcrumbs. Make sure to init Sentry before EF.", e);
            }

            sentryOptions.AddExceptionProcessor(new DbEntityValidationExceptionProcessor());
            // DbConcurrencyExceptionProcessor is untested due to problems with testing it, so it might not be production ready
            //sentryOptions.AddExceptionProcessor(new DbConcurrencyExceptionProcessor());
            return(sentryOptions);
        }