Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

AppStartedConsumer.cs

using Nop.Core.Domain.Customers;
using Nop.Core.Events;
using Nop.Data;
using Nop.Services.Common;
using Nop.Services.Events;

namespace Nop.Services.Orders;

/// 
/// Represents AppStarted event consumer
/// 
public partial class AppStartedConsumer : IConsumer
{
    #region Fields

    protected readonly IGenericAttributeService _genericAttributeService;

    #endregion

    #region Ctor

    public AppStartedConsumer(IGenericAttributeService genericAttributeService)
    {
        _genericAttributeService = genericAttributeService;
    }

    #endregion

    #region Methods

    /// 
    /// Handle event
    /// 
    /// Event
    /// A task that represents the asynchronous operation
    public virtual async Task HandleEventAsync(AppStartedEvent eventMessage)
    {
        if (!DataSettingsManager.IsDatabaseInstalled())
            return;

        //clear payment info requests
        await _genericAttributeService.DeleteAttributesAsync(NopCustomerDefaults.ProcessPaymentRequestAttribute);
    }

    #endregion
}