Skip to content

Commit 47934d9

Browse files
Make a static methods
1 parent 6049f88 commit 47934d9

File tree

41 files changed

+72
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+72
-72
lines changed

src/Business/Grand.Business.Authentication/Services/TwoFactorAuthenticationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ await _customerService.UpdateUserField(customer, SystemCustomerFieldNames.TwoFac
8787
return model;
8888
}
8989

90-
private string PrepareRandomCode()
90+
private static string PrepareRandomCode()
9191
{
9292
var generator = new Random();
9393
return generator.Next(0, 999999).ToString("D6");

src/Business/Grand.Business.Catalog/Services/ExportImport/BrandImportDataObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private async Task UpdateBrandData(BrandDto brandDto, Brand brand)
8181
await _slugService.SaveSlug(brand, seName, "");
8282
}
8383

84-
private bool ValidBrand(Brand brand)
84+
private static bool ValidBrand(Brand brand)
8585
{
8686
return !string.IsNullOrEmpty(brand.Name);
8787
}

src/Business/Grand.Business.Catalog/Services/ExportImport/CategoryImportDataObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private async Task UpdateCategoryData(CategoryDto categoryDto, Category category
8686
await _slugService.SaveSlug(category, seName, "");
8787
}
8888

89-
private bool ValidCategory(Category category)
89+
private static bool ValidCategory(Category category)
9090
{
9191
return !string.IsNullOrEmpty(category.Name);
9292
}

src/Business/Grand.Business.Catalog/Services/ExportImport/CollectionImportDataObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private async Task UpdateCollectionData(CollectionDto collectionDto, Collection
8383
await _slugService.SaveSlug(collection, sename, "");
8484
}
8585

86-
private bool ValidCollection(Collection collection)
86+
private static bool ValidCollection(Collection collection)
8787
{
8888
return !string.IsNullOrEmpty(collection.Name);
8989
}

src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private async Task PrepareProductPictures(ProductDto productDto, Product product
265265
}
266266
}
267267

268-
private bool ValidProduct(Product product)
268+
private static bool ValidProduct(Product product)
269269
{
270270
return !string.IsNullOrEmpty(product.Name);
271271
}

src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void Configure(WebApplication application, IWebHostEnvironment webHostEnv
4444
public int Priority => 100;
4545
public bool BeforeConfigure => false;
4646

47-
private void RegisterCatalogService(IServiceCollection serviceCollection)
47+
private static void RegisterCatalogService(IServiceCollection serviceCollection)
4848
{
4949
serviceCollection.AddScoped<IOutOfStockSubscriptionService, OutOfStockSubscriptionService>();
5050
serviceCollection.AddScoped<ICategoryService, CategoryService>();
@@ -77,21 +77,21 @@ private void RegisterCatalogService(IServiceCollection serviceCollection)
7777
serviceCollection.AddScoped<IMeasureService, MeasureService>();
7878
}
7979

80-
private void RegisterDiscountsService(IServiceCollection serviceCollection)
80+
private static void RegisterDiscountsService(IServiceCollection serviceCollection)
8181
{
8282
serviceCollection.AddScoped<IDiscountService, DiscountService>();
8383
serviceCollection.AddScoped<IDiscountValidationService, DiscountValidationService>();
8484
serviceCollection.AddScoped<IDiscountProviderLoader, DiscountProviderLoader>();
8585
}
8686

87-
private void RegisterTaxService(IServiceCollection serviceCollection)
87+
private static void RegisterTaxService(IServiceCollection serviceCollection)
8888
{
8989
serviceCollection.AddScoped<ITaxService, TaxService>();
9090
serviceCollection.AddScoped<IVatService, VatService>();
9191
serviceCollection.AddScoped<ITaxCategoryService, TaxCategoryService>();
9292
}
9393

94-
private void RegisterExportImport(IServiceCollection serviceCollection)
94+
private static void RegisterExportImport(IServiceCollection serviceCollection)
9595
{
9696
serviceCollection.AddScoped<ISchemaProperty<Brand>, BrandSchemaProperty>();
9797
serviceCollection.AddScoped<ISchemaProperty<Category>, CategorySchemaProperty>();

src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PrepareOrderCodeCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task<string> Handle(PrepareOrderCodeCommand request, CancellationTo
2424
return await Task.FromResult(code);
2525
}
2626

27-
private string RandomString(int length)
27+
private static string RandomString(int length)
2828
{
2929
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
3030
return new string(Enumerable.Repeat(chars, length)

src/Business/Grand.Business.Checkout/Startup/StartupApplication.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void Configure(WebApplication application, IWebHostEnvironment webHostEnv
3838
public bool BeforeConfigure => false;
3939

4040

41-
private void RegisterOrdersService(IServiceCollection serviceCollection)
41+
private static void RegisterOrdersService(IServiceCollection serviceCollection)
4242
{
4343
serviceCollection.AddScoped<ILoyaltyPointsService, LoyaltyPointsService>();
4444
serviceCollection.AddScoped<IGiftVoucherService, GiftVoucherService>();
@@ -56,13 +56,13 @@ private void RegisterOrdersService(IServiceCollection serviceCollection)
5656
serviceCollection.AddScoped<IOrderReportService, OrderReportService>();
5757
}
5858

59-
private void RegisterPaymentsService(IServiceCollection serviceCollection)
59+
private static void RegisterPaymentsService(IServiceCollection serviceCollection)
6060
{
6161
serviceCollection.AddScoped<IPaymentService, PaymentService>();
6262
serviceCollection.AddScoped<IPaymentTransactionService, PaymentTransactionService>();
6363
}
6464

65-
private void RegisterShippingService(IServiceCollection serviceCollection)
65+
private static void RegisterShippingService(IServiceCollection serviceCollection)
6666
{
6767
serviceCollection.AddScoped<IShipmentService, ShipmentService>();
6868
serviceCollection.AddScoped<IShippingService, ShippingService>();
@@ -72,7 +72,7 @@ private void RegisterShippingService(IServiceCollection serviceCollection)
7272
serviceCollection.AddScoped<IShippingMethodService, ShippingMethodService>();
7373
}
7474

75-
private void RegisterExportImport(IServiceCollection serviceCollection)
75+
private static void RegisterExportImport(IServiceCollection serviceCollection)
7676
{
7777
serviceCollection.AddScoped<ISchemaProperty<Order>, OrderSchemaProperty>();
7878
}

src/Business/Grand.Business.Common/Services/ExportImport/ExcelExportProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public virtual byte[] BuilderExportToByte()
5555
/// </summary>
5656
/// <param name="sheet"></param>
5757
/// <param name="properties"></param>
58-
private void WriteCaption<T>(ISheet sheet, PropertyByName<T>[] properties)
58+
private static void WriteCaption<T>(ISheet sheet, PropertyByName<T>[] properties)
5959
{
6060
var row = sheet.CreateRow(0);
6161
foreach (var caption in properties)
@@ -69,7 +69,7 @@ private void WriteCaption<T>(ISheet sheet, PropertyByName<T>[] properties)
6969
/// <param name="idrow">Row index</param>
7070
/// <param name="properties"></param>
7171
/// <param name="sheet"></param>
72-
private void WriteToXlsx<T>(PropertyByName<T>[] properties, ISheet sheet, T items, int idrow)
72+
private static void WriteToXlsx<T>(PropertyByName<T>[] properties, ISheet sheet, T items, int idrow)
7373
{
7474
var row = sheet.CreateRow(idrow);
7575
foreach (var prop in properties)

src/Business/Grand.Business.Common/Services/Security/EncryptionService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public virtual string DecryptText(string cipherText, string encryptionPrivateKey
9595

9696
#region Utilities
9797

98-
private byte[] EncryptTextToMemory(string data, byte[] key, byte[] iv)
98+
private static byte[] EncryptTextToMemory(string data, byte[] key, byte[] iv)
9999
{
100100
using var ms = new MemoryStream();
101101
using (var cs = new CryptoStream(ms, TripleDES.Create().CreateEncryptor(key, iv), CryptoStreamMode.Write))
@@ -108,7 +108,7 @@ private byte[] EncryptTextToMemory(string data, byte[] key, byte[] iv)
108108
return ms.ToArray();
109109
}
110110

111-
private string DecryptTextFromMemory(byte[] data, byte[] key, byte[] iv)
111+
private static string DecryptTextFromMemory(byte[] data, byte[] key, byte[] iv)
112112
{
113113
using var ms = new MemoryStream(data);
114114
using var cs = new CryptoStream(ms, TripleDES.Create().CreateDecryptor(key, iv), CryptoStreamMode.Read);

0 commit comments

Comments
 (0)