C# 在控制台应用程序项目中向Nop Commerce客户发送邮件

C# 在控制台应用程序项目中向Nop Commerce客户发送邮件,c#,oop,e-commerce,nopcommerce,C#,Oop,E Commerce,Nopcommerce,我是Nop商务项目2.30的初学者。我试着给我的Nop商务部发邮件 特定时段(每12小时)的客户端(数据库中) 我在接口中创建新方法(用于创建客户端列表的列表) Nop.Services.Customers.iccustomerservice并实现此功能,类为 无服务、客户、客户服务。但有一个问题,我无法创建此方法 作为静态方法。请看图片 因为CustomerService类不包含默认值 构造器。这是CustomerService类中唯一的一个构造函数 请看下面 public Custome

我是Nop商务项目2.30的初学者。我试着给我的Nop商务部发邮件

特定时段(每12小时)的客户端(数据库中)

我在接口中创建新方法(用于创建客户端列表的列表)

Nop.Services.Customers.iccustomerservice并实现此功能,类为

无服务、客户、客户服务。但有一个问题,我无法创建此方法

作为静态方法。请看图片

因为CustomerService类不包含默认值

构造器。这是CustomerService类中唯一的一个构造函数

请看下面

 public CustomerService(ICacheManager cacheManager,
            IRepository<Customer> customerRepository,
            IRepository<CustomerRole> customerRoleRepository,
            IRepository<CustomerAttribute> customerAttributeRepository,
            IEncryptionService encryptionService, 
            INewsLetterSubscriptionService newsLetterSubscriptionService,
            RewardPointsSettings rewardPointsSettings, 
            CustomerSettings customerSettings,
            IEventPublisher eventPublisher)
        {
            _cacheManager = cacheManager;
            _customerRepository = customerRepository;
            _customerRoleRepository = customerRoleRepository;
            _customerAttributeRepository = customerAttributeRepository;
            _encryptionService = encryptionService;
            _newsLetterSubscriptionService = newsLetterSubscriptionService;
            _rewardPointsSettings = rewardPointsSettings;
            _customerSettings = customerSettings;
            _eventPublisher = eventPublisher;
        }
public CustomerService(ICacheManager cacheManager,
i储蓄客户储蓄,
I储蓄客户储蓄,
i假定客户属性假定,
EnciryOptionService加密服务,
INewsLetterSubscriptionService新闻稿SubscriptionService,
奖励点设置奖励点设置,
客户设置客户设置,
IEventPublisher事件发布者)
{
_cacheManager=cacheManager;
_customerRepository=customerRepository;
_customerRoleRepository=customerRoleRepository;
_CustomerTributterepository=CustomerTributterepository;
_encryptionService=加密服务;
_时事通讯订阅服务=时事通讯订阅服务;
_奖励点设置=奖励点设置;
_customerSettings=customerSettings;
_eventPublisher=eventPublisher;
}
我不知道如何在外部程序中调用这个参数化构造函数。所以我试着


使我的函数是静态的。任何在nop中创建静态方法的想法。请帮助

我使用WebClient函数执行此任务。我在MVC应用程序中创建了一个用于发送的操作 电子邮件。在特定的界面中,通过webclient从我的控制台应用程序调用此操作

请参阅此链接了解更多信息