Skip to content

Commit 895bc35

Browse files
committed
EntityImporterBase implements IEntityImporter
1 parent 4f951a9 commit 895bc35

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/Libraries/SmartStore.Services/Catalog/Importer/CategoryImporter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace SmartStore.Services.Catalog.Importer
2020
{
21-
public class CategoryImporter : EntityImporterBase, IEntityImporter
21+
public class CategoryImporter : EntityImporterBase
2222
{
2323
private readonly IRepository<Category> _categoryRepository;
2424
private readonly IRepository<UrlRecord> _urlRecordRepository;
@@ -416,7 +416,7 @@ public static string[] DefaultKeyFields
416416
}
417417
}
418418

419-
public void Execute(IImportExecuteContext context)
419+
protected override void Import(IImportExecuteContext context)
420420
{
421421
var srcToDestId = new Dictionary<int, ImportCategoryMapping>();
422422

src/Libraries/SmartStore.Services/Catalog/Importer/ProductImporter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace SmartStore.Services.Catalog.Importer
2020
{
21-
public class ProductImporter : EntityImporterBase, IEntityImporter
21+
public class ProductImporter : EntityImporterBase
2222
{
2323
private readonly IRepository<ProductPicture> _productPictureRepository;
2424
private readonly IRepository<ProductManufacturer> _productManufacturerRepository;
@@ -733,7 +733,7 @@ public static string[] DefaultKeyFields
733733
}
734734
}
735735

736-
public void Execute(IImportExecuteContext context)
736+
protected override void Import(IImportExecuteContext context)
737737
{
738738
var srcToDestId = new Dictionary<int, ImportProductMapping>();
739739

src/Libraries/SmartStore.Services/Customers/Importer/CustomerImporter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace SmartStore.Services.Customers.Importer
2222
{
23-
public class CustomerImporter : EntityImporterBase, IEntityImporter
23+
public class CustomerImporter : EntityImporterBase
2424
{
2525
private const string _attributeKeyGroup = "Customer";
2626

@@ -373,7 +373,7 @@ public static string[] DefaultKeyFields
373373
}
374374
}
375375

376-
public void Execute(IImportExecuteContext context)
376+
protected override void Import(IImportExecuteContext context)
377377
{
378378
var customer = _services.WorkContext.CurrentCustomer;
379379
var allowManagingCustomerRoles = _services.Permissions.Authorize(StandardPermissionProvider.ManageCustomerRoles, customer);

src/Libraries/SmartStore.Services/DataExchange/Import/EntityImporterBase.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace SmartStore.Services.DataExchange.Import
1010
{
11-
public abstract class EntityImporterBase
11+
public abstract class EntityImporterBase : IEntityImporter
1212
{
1313
private const string _imageDownloadFolder = @"Content\DownloadedImages";
1414

@@ -22,6 +22,13 @@ public abstract class EntityImporterBase
2222

2323
public FileDownloadManagerContext DownloaderContext { get; private set; }
2424

25+
protected abstract void Import(IImportExecuteContext context);
26+
27+
public void Execute(IImportExecuteContext context)
28+
{
29+
Import(context);
30+
}
31+
2532
public void Init(IImportExecuteContext context, DataExchangeSettings dataExchangeSettings)
2633
{
2734
UtcNow = DateTime.UtcNow;

0 commit comments

Comments
 (0)