/// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="connection"> The <see cref="DbConnection"/> being used. </param>
 /// <param name="command"> The <see cref="DbCommand" /> that was executing when it failed. </param>
 /// <param name="context"> The <see cref="DbContext" /> currently being used, to null if not known. </param>
 /// <param name="executeMethod"> The <see cref="DbCommand" /> method that was used to execute the command. </param>
 /// <param name="commandId"> A correlation ID that identifies the <see cref="DbCommand" /> instance being used. </param>
 /// <param name="connectionId"> A correlation ID that identifies the <see cref="DbConnection" /> instance being used. </param>
 /// <param name="exception"> The exception that was thrown when execution failed. </param>
 /// <param name="async"> Indicates whether or not the command was executed asynchronously. </param>
 /// <param name="logParameterValues"> Indicates whether or not the application allows logging of parameter values. </param>
 /// <param name="startTime"> The start time of this event. </param>
 /// <param name="duration"> The duration this event. </param>
 public CommandErrorEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] DbConnection connection,
     [NotNull] DbCommand command,
     [CanBeNull] DbContext context,
     DbCommandMethod executeMethod,
     Guid commandId,
     Guid connectionId,
     [NotNull] Exception exception,
     bool async,
     bool logParameterValues,
     DateTimeOffset startTime,
     TimeSpan duration)
     : base(
         eventDefinition,
         messageGenerator,
         connection,
         command,
         context,
         executeMethod,
         commandId,
         connectionId,
         async,
         logParameterValues,
         startTime,
         duration)
     => Exception = exception;
Beispiel #2
0
 public CommandExecutedEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     DbConnection connection,
     DbCommand command,
     DbContext?context,
     DbCommandMethod executeMethod,
     Guid commandId,
     Guid connectionId,
     object?result,
     bool async,
     bool logParameterValues,
     DateTimeOffset startTime,
     TimeSpan duration)
     : base(
         eventDefinition,
         messageGenerator,
         connection,
         command,
         context,
         executeMethod,
         commandId,
         connectionId,
         async,
         logParameterValues,
         startTime,
         duration)
     => Result = result;
Beispiel #3
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="connection"> The <see cref="DbConnection" /> being used. </param>
 /// <param name="command"> The <see cref="DbCommand" /> that was executing when it failed. </param>
 /// <param name="context"> The <see cref="DbContext" /> currently being used, to null if not known. </param>
 /// <param name="executeMethod"> The <see cref="DbCommand" /> method that was used to execute the command. </param>
 /// <param name="commandId"> A correlation ID that identifies the <see cref="DbCommand" /> instance being used. </param>
 /// <param name="connectionId"> A correlation ID that identifies the <see cref="DbConnection" /> instance being used. </param>
 /// <param name="exception"> The exception that was thrown when execution failed. </param>
 /// <param name="async"> Indicates whether or not the command was executed asynchronously. </param>
 /// <param name="logParameterValues"> Indicates whether or not the application allows logging of parameter values. </param>
 /// <param name="startTime"> The start time of this event. </param>
 /// <param name="duration"> The duration this event. </param>
 /// <param name="commandSource"> Source of the command. </param>
 public CommandErrorEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     DbConnection connection,
     DbCommand command,
     DbContext?context,
     DbCommandMethod executeMethod,
     Guid commandId,
     Guid connectionId,
     Exception exception,
     bool async,
     bool logParameterValues,
     DateTimeOffset startTime,
     TimeSpan duration,
     CommandSource commandSource)
     : base(
         eventDefinition,
         messageGenerator,
         connection,
         command,
         context,
         executeMethod,
         commandId,
         connectionId,
         async,
         logParameterValues,
         startTime,
         duration,
         commandSource)
 {
     Exception = exception;
 }
Beispiel #4
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="navigation"> The navigation. </param>
 public SkipNavigationEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IReadOnlySkipNavigation navigation)
     : base(eventDefinition, messageGenerator)
 {
     Navigation = navigation;
 }
Beispiel #5
0
 /// <summary>
 ///     Constructs the event payload for the <see cref="RelationalEventId.IndexPropertiesMappedToNonOverlappingTables" /> event.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="entityType"> The entity type on which the index is defined. </param>
 /// <param name="indexName"> The name of the index. </param>
 /// <param name="indexPropertyNames"> The names of the properties which define the index. </param>
 /// <param name="property1Name"> The name of the first property name which causes this event. </param>
 /// <param name="tablesMappedToProperty1"> The tables mapped to the first property. </param>
 /// <param name="property2Name"> The name of the second property name which causes this event. </param>
 /// <param name="tablesMappedToProperty2"> The tables mapped to the second property. </param>
 public IndexWithPropertiesEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IEntityType entityType,
     string?indexName,
     List <string> indexPropertyNames,
     string property1Name,
     List <(string Table, string?Schema)> tablesMappedToProperty1,
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition">The event definition.</param>
 /// <param name="messageGenerator">A delegate that generates a log message for this event.</param>
 /// <param name="entityEntry">The entry for the entity instance on which the property value has changed.</param>
 public UpdateEntryEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IUpdateEntry entityEntry)
     : base(eventDefinition, messageGenerator, ((InternalEntityEntry)entityEntry).StateManager.Context)
 {
     EntityEntry = entityEntry;
 }
 public IndexWithPropertiesEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] IEntityType entityType,
     [CanBeNull] string?indexName,
     [NotNull] List <string> indexPropertyNames,
     [NotNull] string property1Name,
     [NotNull] List <(string Table, string?Schema)> tablesMappedToProperty1,
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="context"> The current <see cref="DbContext" />. </param>
 public DbContextEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] DbContext context)
     : base(eventDefinition, messageGenerator)
 {
     Context = context;
 }
Beispiel #9
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition">The event definition.</param>
 /// <param name="messageGenerator">A delegate that generates a log message for this event.</param>
 /// <param name="context">The current <see cref="DbContext" />, or null if not known.</param>
 public DbContextEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     DbContext?context)
     : base(eventDefinition, messageGenerator)
 {
     Context = context;
 }
Beispiel #10
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="contextType"> The current <see cref="DbContext" />. </param>
 public DbContextTypeEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     Type contextType)
     : base(eventDefinition, messageGenerator)
 {
     ContextType = contextType;
 }
Beispiel #11
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="sequence"> The sequence. </param>
 public SequenceEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IReadOnlySequence sequence)
     : base(eventDefinition, messageGenerator)
 {
     Sequence = sequence;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="entityEntry"> The entry for the entity instance on which the property value has changed. </param>
 public UpdateEntryEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IUpdateEntry entityEntry)
     : base(eventDefinition, messageGenerator)
 {
     EntityEntry = entityEntry;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="queryModel"> The <see cref="QueryModel" />. </param>
 public QueryModelEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] QueryModel queryModel)
     : base(eventDefinition, messageGenerator)
 {
     QueryModel = queryModel;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="property"> The property. </param>
 public PropertyEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] IProperty property)
     : base(eventDefinition, messageGenerator)
 {
     Property = property;
 }
Beispiel #15
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="migrator">
 ///     The <see cref="IMigrator" /> in use.
 /// </param>
 public MigratorEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IMigrator migrator)
     : base(eventDefinition, messageGenerator)
 {
     Migrator = migrator;
 }
 public MigratorEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] IMigrator migrator)
     : base(eventDefinition, messageGenerator)
 {
     Migrator = migrator;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition">The event definition.</param>
 /// <param name="messageGenerator">A delegate that generates a log message for this event.</param>
 /// <param name="navigationBase">The navigation base.</param>
 public NavigationBaseEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IReadOnlyNavigationBase navigationBase)
     : base(eventDefinition, messageGenerator)
 {
     NavigationBase = navigationBase;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="foreignKey"> The foreign key. </param>
 public ForeignKeyEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] IForeignKey foreignKey)
     : base(eventDefinition, messageGenerator)
 {
     ForeignKey = foreignKey;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="serviceProvider"> The <see cref="IServiceProvider" />. </param>
 public ServiceProviderEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IServiceProvider serviceProvider)
     : base(eventDefinition, messageGenerator)
 {
     ServiceProvider = serviceProvider;
 }
Beispiel #20
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="includeResultOperator"> The <see cref="IncludeResultOperator"/>. </param>
 public IncludeEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] IncludeResultOperator includeResultOperator)
     : base(eventDefinition, messageGenerator)
 {
     IncludeResultOperator = includeResultOperator;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="sequence"> The sequence. </param>
 public SequenceEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] ISequence sequence)
     : base(eventDefinition, messageGenerator)
 {
     Sequence = sequence;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="navigationPath"> The navigation property. </param>
 public NavigationPathEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] IReadOnlyCollection <IPropertyBase> navigationPath)
     : base(eventDefinition, messageGenerator)
 {
     NavigationPath = navigationPath;
 }
Beispiel #23
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="navigation"> The navigation. </param>
 public NavigationEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] INavigation navigation)
     : base(eventDefinition, messageGenerator)
 {
     Navigation = navigation;
 }
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="serviceProviders"> The <see cref="IServiceProvider" />s. </param>
 public ServiceProvidersEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     ICollection <IServiceProvider> serviceProviders)
     : base(eventDefinition, messageGenerator)
 {
     ServiceProviders = serviceProviders;
 }
Beispiel #25
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="entityType"> The entityType. </param>
 public EntityTypeEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IReadOnlyEntityType entityType)
     : base(eventDefinition, messageGenerator)
 {
     EntityType = entityType;
 }
 public ExpressionEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] Expression expression)
     : base(eventDefinition, messageGenerator)
 {
     Expression = expression;
 }
Beispiel #27
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition">The event definition.</param>
 /// <param name="messageGenerator">A delegate that generates a log message for this event.</param>
 /// <param name="property">The property.</param>
 public PropertyEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IReadOnlyProperty property)
     : base(eventDefinition, messageGenerator)
 {
     Property = property;
 }
 public MigrationTypeEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] TypeInfo migrationType)
     : base(eventDefinition, messageGenerator)
 {
     MigrationType = migrationType;
 }
Beispiel #29
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition">The event definition.</param>
 /// <param name="messageGenerator">A delegate that generates a log message for this event.</param>
 /// <param name="foreignKey">The foreign key.</param>
 public ForeignKeyEventData(
     EventDefinitionBase eventDefinition,
     Func <EventDefinitionBase, EventData, string> messageGenerator,
     IReadOnlyForeignKey foreignKey)
     : base(eventDefinition, messageGenerator)
 {
     ForeignKey = foreignKey;
 }
Beispiel #30
0
 /// <summary>
 ///     Constructs the event payload.
 /// </summary>
 /// <param name="eventDefinition"> The event definition. </param>
 /// <param name="messageGenerator"> A delegate that generates a log message for this event. </param>
 /// <param name="contextType"> The type of the current <see cref="DbContext" />. </param>
 /// <param name="exception"> The exception that triggered this event. </param>
 public DbContextTypeErrorEventData(
     [NotNull] EventDefinitionBase eventDefinition,
     [NotNull] Func <EventDefinitionBase, EventData, string> messageGenerator,
     [NotNull] Type contextType,
     [NotNull] Exception exception)
     : base(eventDefinition, messageGenerator, contextType)
 {
     Exception = exception;
 }