Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Grand.Business.System - Code cleanup (ReSharper)
support63a2a2902d93
diff --git a/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendNotificationsToSubscribersCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendNotificationsToSubscribersCommandHandler.csindex 7a467501f..e4bf2af69 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendNotificationsToSubscribersCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendNotificationsToSubscribersCommandHandler.cs@@ -1,75 +1,78 @@using Grand.Business.Core.Commands.Catalog;using Grand.Business.Core.Interfaces.Customers;using Grand.Business.Core.Interfaces.Messages;+using Grand.Data;using Grand.Domain.Catalog;using Grand.Domain.Common;using Grand.Domain.Customers;-using Grand.Data;using Grand.SharedKernel.Extensions;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Catalog+namespace Grand.Business.System.Commands.Handlers.Catalog;++public class+ SendNotificationsToSubscribersCommandHandler : IRequestHandler<SendNotificationsToSubscribersCommand,+ IList<OutOfStockSubscription>>{- public class SendNotificationsToSubscribersCommandHandler : IRequestHandler<SendNotificationsToSubscribersCommand, IList<OutOfStockSubscription>>+ private readonly ICustomerService _customerService;+ private readonly IMessageProviderService _messageProviderService;+ private readonly IRepository<OutOfStockSubscription> _outOfStockSubscriptionRepository;++ public SendNotificationsToSubscribersCommandHandler(+ ICustomerService customerService,+ IMessageProviderService messageProviderService,+ IRepository<OutOfStockSubscription> outOfStockSubscriptionRepository){- private readonly ICustomerService _customerService;- private readonly IMessageProviderService _messageProviderService;- private readonly IRepository<OutOfStockSubscription> _outOfStockSubscriptionRepository;+ _customerService = customerService;+ _messageProviderService = messageProviderService;+ _outOfStockSubscriptionRepository = outOfStockSubscriptionRepository;+ }- public SendNotificationsToSubscribersCommandHandler(- ICustomerService customerService,- IMessageProviderService messageProviderService,- IRepository<OutOfStockSubscription> outOfStockSubscriptionRepository)- {- _customerService = customerService;- _messageProviderService = messageProviderService;- _outOfStockSubscriptionRepository = outOfStockSubscriptionRepository;- }+ public async Task<IList<OutOfStockSubscription>> Handle(SendNotificationsToSubscribersCommand request,+ CancellationToken cancellationToken)+ {+ if (request.Product == null)+ throw new ArgumentNullException(nameof(request.Product));- public async Task<IList<OutOfStockSubscription>> Handle(SendNotificationsToSubscribersCommand request, CancellationToken cancellationToken)+ var subscriptions =+ await GetAllSubscriptionsByProductId(request.Product.Id, request.Attributes, request.Warehouse);+ foreach (var subscription in subscriptions){- if (request.Product == null)- throw new ArgumentNullException(nameof(request.Product));-- var subscriptions = await GetAllSubscriptionsByProductId(request.Product.Id, request.Attributes, request.Warehouse);- foreach (var subscription in subscriptions)- {- var customer = await _customerService.GetCustomerById(subscription.CustomerId);- //ensure that customer is registered (simple and fast way)- if (customer == null || !CommonHelper.IsValidEmail(customer.Email)) continue;- var customerLanguageId = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LanguageId, subscription.StoreId);- await _messageProviderService.SendBackInStockMessage(customer, request.Product, subscription, customerLanguageId);- }-- return subscriptions;-+ var customer = await _customerService.GetCustomerById(subscription.CustomerId);+ //ensure that customer is registered (simple and fast way)+ if (customer == null || !CommonHelper.IsValidEmail(customer.Email)) continue;+ var customerLanguageId =+ customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LanguageId, subscription.StoreId);+ await _messageProviderService.SendBackInStockMessage(customer, request.Product, subscription,+ customerLanguageId);}- /// <summary>- /// Gets all subscriptions- /// </summary>- /// <param name="productId">Product identifier</param>- /// <param name="attributes">Attributes</param>- /// <param name="warehouseId">Store identifier; pass "" to load all records</param>- /// <returns>Subscriptions</returns>- private async Task<IList<OutOfStockSubscription>> GetAllSubscriptionsByProductId(string productId, IList<CustomAttribute> attributes, string warehouseId)- {- var query = _outOfStockSubscriptionRepository.Table- .Where(biss => biss.ProductId == productId)- .OrderByDescending(biss => biss.CreatedOnUtc).ToList();+ return subscriptions;+ }++ /// <summary>+ /// Gets all subscriptions+ /// </summary>+ /// <param name="productId">Product identifier</param>+ /// <param name="attributes">Attributes</param>+ /// <param name="warehouseId">Store identifier; pass "" to load all records</param>+ /// <returns>Subscriptions</returns>+ private async Task<IList<OutOfStockSubscription>> GetAllSubscriptionsByProductId(string productId,+ IList<CustomAttribute> attributes, string warehouseId)+ {+ var query = _outOfStockSubscriptionRepository.Table+ .Where(biss => biss.ProductId == productId)+ .OrderByDescending(biss => biss.CreatedOnUtc).ToList();- //warehouse- if (!string.IsNullOrEmpty(warehouseId))- query = query.Where(biss => biss.WarehouseId == warehouseId).ToList();+ //warehouse+ if (!string.IsNullOrEmpty(warehouseId))+ query = query.Where(biss => biss.WarehouseId == warehouseId).ToList();- //attributes- if (attributes == null || !attributes.Any()) return await Task.FromResult(query.ToList());- foreach (var item in attributes)- {- query = query.Where(x => x.Attributes.Any(y => y.Key == item.Key && y.Value == item.Value)).ToList();- }+ //attributes+ if (attributes == null || !attributes.Any()) return await Task.FromResult(query.ToList());+ foreach (var item in attributes)+ query = query.Where(x => x.Attributes.Any(y => y.Key == item.Key && y.Value == item.Value)).ToList();- return await Task.FromResult(query.ToList());- }+ return await Task.FromResult(query.ToList());}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendOutBidCustomerNotificationCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendOutBidCustomerNotificationCommandHandler.csindex 6bf94cbc9..45529a990 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendOutBidCustomerNotificationCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendOutBidCustomerNotificationCommandHandler.cs@@ -2,21 +2,20 @@using Grand.Business.Core.Interfaces.Messages;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Catalog+namespace Grand.Business.System.Commands.Handlers.Catalog;++public class SendOutBidCustomerNotificationCommandHandler : IRequestHandler<SendOutBidCustomerCommand, bool>{- public class SendOutBidCustomerNotificationCommandHandler : IRequestHandler<SendOutBidCustomerCommand, bool>- {- private readonly IMessageProviderService _messageProviderService;+ private readonly IMessageProviderService _messageProviderService;- public SendOutBidCustomerNotificationCommandHandler(IMessageProviderService messageProviderService)- {- _messageProviderService = messageProviderService;- }+ public SendOutBidCustomerNotificationCommandHandler(IMessageProviderService messageProviderService)+ {+ _messageProviderService = messageProviderService;+ }- public async Task<bool> Handle(SendOutBidCustomerCommand request, CancellationToken cancellationToken)- {- await _messageProviderService.SendOutBidCustomerMessage(request.Product, request.Language.Id, request.Bid);- return true;- }+ public async Task<bool> Handle(SendOutBidCustomerCommand request, CancellationToken cancellationToken)+ {+ await _messageProviderService.SendOutBidCustomerMessage(request.Product, request.Language.Id, request.Bid);+ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendQuantityBelowStoreOwnerNotificationCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendQuantityBelowStoreOwnerNotificationCommandHandler.csindex ddc230151..990e53590 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendQuantityBelowStoreOwnerNotificationCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Catalog/SendQuantityBelowStoreOwnerNotificationCommandHandler.cs@@ -3,29 +3,31 @@ using Grand.Business.Core.Interfaces.Messages;using Grand.Domain.Localization;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Catalog+namespace Grand.Business.System.Commands.Handlers.Catalog;++public class+ SendQuantityBelowStoreOwnerNotificationCommandHandler : IRequestHandler<SendQuantityBelowStoreOwnerCommand, bool>{- public class SendQuantityBelowStoreOwnerNotificationCommandHandler : IRequestHandler<SendQuantityBelowStoreOwnerCommand, bool>- {- private readonly IMessageProviderService _messageProviderService;- private readonly LanguageSettings _languageSettings;+ private readonly LanguageSettings _languageSettings;+ private readonly IMessageProviderService _messageProviderService;- public SendQuantityBelowStoreOwnerNotificationCommandHandler(- IMessageProviderService messageProviderService,- LanguageSettings languageSettings)- {- _messageProviderService = messageProviderService;- _languageSettings = languageSettings;- }+ public SendQuantityBelowStoreOwnerNotificationCommandHandler(+ IMessageProviderService messageProviderService,+ LanguageSettings languageSettings)+ {+ _messageProviderService = messageProviderService;+ _languageSettings = languageSettings;+ }- public async Task<bool> Handle(SendQuantityBelowStoreOwnerCommand request, CancellationToken cancellationToken)- {- if (request.ProductAttributeCombination == null)- await _messageProviderService.SendQuantityBelowStoreOwnerMessage(request.Product, _languageSettings.DefaultAdminLanguageId);- else- await _messageProviderService.SendQuantityBelowStoreOwnerMessage(request.Product, request.ProductAttributeCombination, _languageSettings.DefaultAdminLanguageId);+ public async Task<bool> Handle(SendQuantityBelowStoreOwnerCommand request, CancellationToken cancellationToken)+ {+ if (request.ProductAttributeCombination == null)+ await _messageProviderService.SendQuantityBelowStoreOwnerMessage(request.Product,+ _languageSettings.DefaultAdminLanguageId);+ else+ await _messageProviderService.SendQuantityBelowStoreOwnerMessage(request.Product,+ request.ProductAttributeCombination, _languageSettings.DefaultAdminLanguageId);- return true;- }+ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Common/ClearMostViewedCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Common/ClearMostViewedCommandHandler.csindex 44ac3b706..060a44cd7 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Common/ClearMostViewedCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Common/ClearMostViewedCommandHandler.cs@@ -1,25 +1,24 @@using Grand.Business.Core.Commands.System.Common;-using Grand.Domain.Catalog;using Grand.Data;+using Grand.Domain.Catalog;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Common+namespace Grand.Business.System.Commands.Handlers.Common;++public class ClearMostViewedCommandHandler : IRequestHandler<ClearMostViewedCommand, bool>{- public class ClearMostViewedCommandHandler : IRequestHandler<ClearMostViewedCommand, bool>- {- private readonly IRepository<Product> _repositoryProduct;+ private readonly IRepository<Product> _repositoryProduct;- public ClearMostViewedCommandHandler(IRepository<Product> repositoryProduct)- {- _repositoryProduct = repositoryProduct;- }+ public ClearMostViewedCommandHandler(IRepository<Product> repositoryProduct)+ {+ _repositoryProduct = repositoryProduct;+ }- public async Task<bool> Handle(ClearMostViewedCommand request, CancellationToken cancellationToken)- {- await _repositoryProduct.UpdateManyAsync(x => x.Viewed != 0,- UpdateBuilder<Product>.Create().Set(x => x.Viewed, 0));+ public async Task<bool> Handle(ClearMostViewedCommand request, CancellationToken cancellationToken)+ {+ await _repositoryProduct.UpdateManyAsync(x => x.Viewed != 0,+ UpdateBuilder<Product>.Create().Set(x => x.Viewed, 0));- return true;- }+ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Common/GetSitemapXMLCommandHandler.csindex d1c1f7917..41ed745bf 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs@@ -1,10 +1,10 @@-using Grand.Business.Core.Interfaces.Catalog.Brands;+using Grand.Business.Core.Commands.System.Common;+using Grand.Business.Core.Extensions;+using Grand.Business.Core.Interfaces.Catalog.Brands;using Grand.Business.Core.Interfaces.Catalog.Categories;using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Cms;-using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Storage;-using Grand.Business.Core.Commands.System.Common;using Grand.Domain.Blogs;using Grand.Domain.Catalog;using Grand.Domain.Common;@@ -19,457 +19,473 @@ using Microsoft.AspNetCore.Routing;using System.Text.RegularExpressions;using System.Xml;-namespace Grand.Business.System.Commands.Handlers.Common+namespace Grand.Business.System.Commands.Handlers.Common;++public class GetSitemapXmlCommandHandler : IRequestHandler<GetSitemapXmlCommand, string>{- public class GetSitemapXmlCommandHandler : IRequestHandler<GetSitemapXmlCommand, string>+ private const string DateFormat = "yyyy-MM-dd";+ private readonly AppConfig _appConfig;+ private readonly IBlogService _blogService;+ private readonly BlogSettings _blogSettings;+ private readonly IBrandService _brandService;++ private readonly ICategoryService _categoryService;+ private readonly CommonSettings _commonSettings;+ private readonly IKnowledgebaseService _knowledgebaseService;+ private readonly KnowledgebaseSettings _knowledgebaseSettings;+ private readonly LinkGenerator _linkGenerator;+ private readonly NewsSettings _newsSettings;+ private readonly IPageService _pageService;+ private readonly IPictureService _pictureService;+ private readonly IProductService _productService;++ private GetSitemapXmlCommand _request;++ public GetSitemapXmlCommandHandler(+ ICategoryService categoryService,+ IProductService productService,+ IBrandService brandService,+ IPageService pageService,+ IBlogService blogService,+ IPictureService pictureService,+ IKnowledgebaseService knowledgebaseService,+ CommonSettings commonSettings,+ BlogSettings blogSettings,+ KnowledgebaseSettings knowledgebaseSettings,+ NewsSettings newsSettings,+ LinkGenerator linkGenerator,+ AppConfig appConfig){- private const string DateFormat = "yyyy-MM-dd";-- private readonly ICategoryService _categoryService;- private readonly IProductService _productService;- private readonly IBrandService _brandService;- private readonly IPageService _pageService;- private readonly IBlogService _blogService;- private readonly IKnowledgebaseService _knowledgebaseService;- private readonly IPictureService _pictureService;- private readonly CommonSettings _commonSettings;- private readonly KnowledgebaseSettings _knowledgebaseSettings;- private readonly NewsSettings _newsSettings;- private readonly BlogSettings _blogSettings;- private readonly LinkGenerator _linkGenerator;- private readonly AppConfig _appConfig;-- private GetSitemapXmlCommand _request;-- public GetSitemapXmlCommandHandler(- ICategoryService categoryService,- IProductService productService,- IBrandService brandService,- IPageService pageService,- IBlogService blogService,- IPictureService pictureService,- IKnowledgebaseService knowledgebaseService,- CommonSettings commonSettings,- BlogSettings blogSettings,- KnowledgebaseSettings knowledgebaseSettings,- NewsSettings newsSettings,- LinkGenerator linkGenerator,- AppConfig appConfig)- {- _categoryService = categoryService;- _productService = productService;- _brandService = brandService;- _pageService = pageService;- _blogService = blogService;- _pictureService = pictureService;- _commonSettings = commonSettings;- _knowledgebaseService = knowledgebaseService;- _knowledgebaseSettings = knowledgebaseSettings;- _newsSettings = newsSettings;- _blogSettings = blogSettings;- _linkGenerator = linkGenerator;- _appConfig = appConfig;- }+ _categoryService = categoryService;+ _productService = productService;+ _brandService = brandService;+ _pageService = pageService;+ _blogService = blogService;+ _pictureService = pictureService;+ _commonSettings = commonSettings;+ _knowledgebaseService = knowledgebaseService;+ _knowledgebaseSettings = knowledgebaseSettings;+ _newsSettings = newsSettings;+ _blogSettings = blogSettings;+ _linkGenerator = linkGenerator;+ _appConfig = appConfig;+ }- public async Task<string> Handle(GetSitemapXmlCommand request, CancellationToken cancellationToken)- {- _request = request;- return await Generate(request.Language, request.Store);+ public async Task<string> Handle(GetSitemapXmlCommand request, CancellationToken cancellationToken)+ {+ _request = request;+ return await Generate(request.Language, request.Store);+ }- }- private string RemoveBom(string p)- {- var bomMarkUtf8 = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());- if (p.StartsWith(bomMarkUtf8))- p = p.Remove(0, bomMarkUtf8.Length);- return p.Replace("\0", "");- }- private async Task<string> Generate(Language language, Store store)- {- using var stream = new MemoryStream();- await Generate(stream, language, store);- return RemoveBom(Encoding.UTF8.GetString(stream.ToArray()));- }+ private string RemoveBom(string p)+ {+ var bomMarkUtf8 = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());+ if (p.StartsWith(bomMarkUtf8))+ p = p.Remove(0, bomMarkUtf8.Length);+ return p.Replace("\0", "");+ }- private async Task Generate(Stream stream, Language language, Store store)- {- //generate all URLs for the sitemap- var sitemapUrls = await GenerateUrls(language, store);+ private async Task<string> Generate(Language language, Store store)+ {+ using var stream = new MemoryStream();+ await Generate(stream, language, store);+ return RemoveBom(Encoding.UTF8.GetString(stream.ToArray()));+ }- await WriteSitemap(stream, sitemapUrls);+ private async Task Generate(Stream stream, Language language, Store store)+ {+ //generate all URLs for the sitemap+ var sitemapUrls = await GenerateUrls(language, store);- }+ await WriteSitemap(stream, sitemapUrls);+ }- /// <summary>- /// Represents sitemap URL- /// </summary>- private class SitemapUrl- {- public SitemapUrl(string location, string image, UpdateFrequency frequency, DateTime updatedOn)- {- Location = location;- Image = image;- UpdateFrequency = frequency;- UpdatedOn = updatedOn;- }+ /// <summary>+ /// Get HTTP protocol+ /// </summary>+ /// <returns>Protocol name as string</returns>+ private string GetHttpProtocol()+ {+ return _request.Store.SslEnabled ? "https" : "http";+ }- /// <summary>- /// Gets or sets URL of the page- /// </summary>- public string Location { get; set; }-- /// <summary>- /// Gets or sets URL of the image- /// </summary>- public string Image { get; set; }-- /// <summary>- /// Gets or sets a value indicating how frequently the page is likely to change- /// </summary>- public UpdateFrequency UpdateFrequency { get; set; }-- /// <summary>- /// Gets or sets the date of last modification of the file- /// </summary>- public DateTime UpdatedOn { get; set; }- }+ /// <summary>+ /// Get HTTP protocol+ /// </summary>+ /// <returns>Protocol name as string</returns>+ private HostString GetHost()+ {+ return _request.Store.SslEnabled+ ? new HostString(_request.Store.SecureUrl.Replace("https://", "").Trim('/'))+ : new HostString(_request.Store.Url.Replace("http://", "").Trim('/'));+ }- /// <summary>- /// Get HTTP protocol- /// </summary>- /// <returns>Protocol name as string</returns>- private string GetHttpProtocol()- {- return _request.Store.SslEnabled ? "https" : "http";- }- /// <summary>- /// Get HTTP protocol- /// </summary>- /// <returns>Protocol name as string</returns>- private HostString GetHost()+ /// <summary>+ /// Get store location+ /// </summary>+ /// <returns>Store url</returns>+ private string GetStoreLocation()+ {+ return _request.Store.SslEnabled ? _request.Store.SecureUrl : _request.Store.Url;+ }++ private async Task<IList<SitemapUrl>> GenerateUrls(Language language, Store store)+ {+ var sitemapUrls = new List<SitemapUrl>();+ var routeValues = !_appConfig.SeoFriendlyUrlsForLanguagesEnabled+ ? null+ : new { language = language.UniqueSeoCode };++ //home page+ var homePageUrl = _linkGenerator.GetUriByRouteValues("HomePage", routeValues, GetHttpProtocol(), GetHost());+ sitemapUrls.Add(new SitemapUrl(homePageUrl, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));++ //search products+ var productSearchUrl =+ _linkGenerator.GetUriByRouteValues("ProductSearch", routeValues, GetHttpProtocol(), GetHost());+ sitemapUrls.Add(new SitemapUrl(productSearchUrl, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));++ //contact us+ var contactUsUrl = _linkGenerator.GetUriByRouteValues("ContactUs", routeValues, GetHttpProtocol(), GetHost());+ sitemapUrls.Add(new SitemapUrl(contactUsUrl, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));++ //news+ if (_newsSettings.Enabled){- return _request.Store.SslEnabled ?- new HostString(_request.Store.SecureUrl.Replace("https://", "").Trim('/')) :- new HostString(_request.Store.Url.Replace("http://", "").Trim('/'));+ var url = _linkGenerator.GetUriByRouteValues("NewsArchive", routeValues, GetHttpProtocol(), GetHost());+ sitemapUrls.Add(new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));}- /// <summary>- /// Get store location- /// </summary>- /// <returns>Store url</returns>- private string GetStoreLocation()++ //blog+ if (_blogSettings.Enabled){- return _request.Store.SslEnabled ? _request.Store.SecureUrl : _request.Store.Url;+ var url = _linkGenerator.GetUriByRouteValues("Blog", routeValues, GetHttpProtocol(), GetHost());+ sitemapUrls.Add(new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));}- private async Task<IList<SitemapUrl>> GenerateUrls(Language language, Store store)+ //knowledge base+ if (_knowledgebaseSettings.Enabled){- var sitemapUrls = new List<SitemapUrl>();- var routeValues = !_appConfig.SeoFriendlyUrlsForLanguagesEnabled ? null : new { language = language.UniqueSeoCode };-- //home page- var homePageUrl = _linkGenerator.GetUriByRouteValues("HomePage", routeValues, GetHttpProtocol(), GetHost());- sitemapUrls.Add(new SitemapUrl(homePageUrl, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));-- //search products- var productSearchUrl = _linkGenerator.GetUriByRouteValues("ProductSearch", routeValues, GetHttpProtocol(), GetHost());- sitemapUrls.Add(new SitemapUrl(productSearchUrl, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));-- //contact us- var contactUsUrl = _linkGenerator.GetUriByRouteValues("ContactUs", routeValues, GetHttpProtocol(), GetHost());- sitemapUrls.Add(new SitemapUrl(contactUsUrl, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));-- //news- if (_newsSettings.Enabled)- {- var url = _linkGenerator.GetUriByRouteValues("NewsArchive", routeValues, GetHttpProtocol(), GetHost());- sitemapUrls.Add(new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));- }-- //blog- if (_blogSettings.Enabled)- {- var url = _linkGenerator.GetUriByRouteValues("Blog", routeValues, GetHttpProtocol(), GetHost());- sitemapUrls.Add(new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));- }-- //knowledge base- if (_knowledgebaseSettings.Enabled)- {- var url = _linkGenerator.GetUriByRouteValues("Knowledgebase", routeValues, GetHttpProtocol(), GetHost());- sitemapUrls.Add(new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));- }+ var url = _linkGenerator.GetUriByRouteValues("Knowledgebase", routeValues, GetHttpProtocol(), GetHost());+ sitemapUrls.Add(new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));+ }- //categories- if (_commonSettings.SitemapIncludeCategories)- sitemapUrls.AddRange(await GetCategoryUrls("", language));+ //categories+ if (_commonSettings.SitemapIncludeCategories)+ sitemapUrls.AddRange(await GetCategoryUrls("", language));- //brands- if (_commonSettings.SitemapIncludeBrands)- sitemapUrls.AddRange(await GetBrandUrls(language, store));+ //brands+ if (_commonSettings.SitemapIncludeBrands)+ sitemapUrls.AddRange(await GetBrandUrls(language, store));- //products- if (_commonSettings.SitemapIncludeProducts)- sitemapUrls.AddRange(await GetProductUrls(language, store));+ //products+ if (_commonSettings.SitemapIncludeProducts)+ sitemapUrls.AddRange(await GetProductUrls(language, store));- //topics- sitemapUrls.AddRange(await GetPagesUrls(language, store));+ //topics+ sitemapUrls.AddRange(await GetPagesUrls(language, store));- //blog posts- sitemapUrls.AddRange(await GetBlogPostsUrls(language, store));+ //blog posts+ sitemapUrls.AddRange(await GetBlogPostsUrls(language, store));- //knowledge base articles- sitemapUrls.AddRange(await GetKnowledgebaseUrls(language));+ //knowledge base articles+ sitemapUrls.AddRange(await GetKnowledgebaseUrls(language));- //custom URLs- sitemapUrls.AddRange(GetCustomUrls());+ //custom URLs+ sitemapUrls.AddRange(GetCustomUrls());- return sitemapUrls;- }+ return sitemapUrls;+ }- private async Task<IEnumerable<SitemapUrl>> GetCategoryUrls(string parentCategoryId, Language language)+ private async Task<IEnumerable<SitemapUrl>> GetCategoryUrls(string parentCategoryId, Language language)+ {+ var allCategoriesByParentCategoryId =+ await _categoryService.GetAllCategoriesByParentCategoryId(parentCategoryId);+ var categories = new List<SitemapUrl>();+ var storeLocation = GetStoreLocation();+ foreach (var category in allCategoriesByParentCategoryId){- var allCategoriesByParentCategoryId = await _categoryService.GetAllCategoriesByParentCategoryId(parentCategoryId: parentCategoryId);- var categories = new List<SitemapUrl>();- var storeLocation = GetStoreLocation();- foreach (var category in allCategoriesByParentCategoryId)- {-- var url =- _appConfig.SeoFriendlyUrlsForLanguagesEnabled ?- _linkGenerator.GetUriByRouteValues("Category", new { SeName = category.GetSeName(language.Id), language = language.UniqueSeoCode }, GetHttpProtocol(), GetHost())- :- _linkGenerator.GetUriByRouteValues("Category", new { SeName = category.GetSeName(language.Id) }, GetHttpProtocol(), GetHost());-- var imageurl = string.Empty;- if (_commonSettings.SitemapIncludeImage)- {- if (!string.IsNullOrEmpty(category.PictureId))- {- imageurl = await _pictureService.GetPictureUrl(category.PictureId, showDefaultPicture: false, storeLocation: storeLocation);- }- }- categories.Add(new SitemapUrl(url, imageurl, UpdateFrequency.Weekly, category.UpdatedOnUtc ?? category.CreatedOnUtc));- categories.AddRange(await GetCategoryUrls(category.Id, language));- }- return categories;+ var url =+ _appConfig.SeoFriendlyUrlsForLanguagesEnabled+ ? _linkGenerator.GetUriByRouteValues("Category",+ new { SeName = category.GetSeName(language.Id), language = language.UniqueSeoCode },+ GetHttpProtocol(), GetHost())+ : _linkGenerator.GetUriByRouteValues("Category", new { SeName = category.GetSeName(language.Id) },+ GetHttpProtocol(), GetHost());++ var imageurl = string.Empty;+ if (_commonSettings.SitemapIncludeImage)+ if (!string.IsNullOrEmpty(category.PictureId))+ imageurl = await _pictureService.GetPictureUrl(category.PictureId, showDefaultPicture: false,+ storeLocation: storeLocation);+ categories.Add(new SitemapUrl(url, imageurl, UpdateFrequency.Weekly,+ category.UpdatedOnUtc ?? category.CreatedOnUtc));+ categories.AddRange(await GetCategoryUrls(category.Id, language));}- private async Task<IEnumerable<SitemapUrl>> GetBrandUrls(Language language, Store store)- {- var brands = await _brandService.GetAllBrands(storeId: store.Id);- var brandUrls = new List<SitemapUrl>();- var storeLocation = GetStoreLocation();- foreach (var brand in brands)- {- var url =- _appConfig.SeoFriendlyUrlsForLanguagesEnabled ?- _linkGenerator.GetUriByRouteValues("Brand", new { SeName = brand.GetSeName(language.Id), language = language.UniqueSeoCode }, GetHttpProtocol(), GetHost())- :- _linkGenerator.GetUriByRouteValues("Brand", new { SeName = brand.GetSeName(language.Id) }, GetHttpProtocol(), GetHost());-- var imageUrl = string.Empty;- if (_commonSettings.SitemapIncludeImage)- {- if (!string.IsNullOrEmpty(brand.PictureId))- {- imageUrl = await _pictureService.GetPictureUrl(brand.PictureId, showDefaultPicture: false, storeLocation: storeLocation);- }- }- brandUrls.Add(new SitemapUrl(url, imageUrl, UpdateFrequency.Weekly, brand.UpdatedOnUtc ?? brand.CreatedOnUtc));- }- return brandUrls;- }+ return categories;+ }- private async Task<IEnumerable<SitemapUrl>> GetProductUrls(Language language, Store store)+ private async Task<IEnumerable<SitemapUrl>> GetBrandUrls(Language language, Store store)+ {+ var brands = await _brandService.GetAllBrands(storeId: store.Id);+ var brandUrls = new List<SitemapUrl>();+ var storeLocation = GetStoreLocation();+ foreach (var brand in brands){- var search = await _productService.SearchProducts(storeId: store.Id,- visibleIndividuallyOnly: true, orderBy: ProductSortingEnum.CreatedOn);- var storeLocation = GetStoreLocation();- var products = new List<SitemapUrl>();- foreach (var product in search.products)- {- var url =- _appConfig.SeoFriendlyUrlsForLanguagesEnabled ?- _linkGenerator.GetUriByRouteValues("Product", new { SeName = product.GetSeName(language.Id), language = language.UniqueSeoCode }, GetHttpProtocol(), GetHost())- :- _linkGenerator.GetUriByRouteValues("Product", new { SeName = product.GetSeName(language.Id) }, GetHttpProtocol(), GetHost());-- var imageUrl = string.Empty;- if (_commonSettings.SitemapIncludeImage)- {- if (!string.IsNullOrEmpty(product.ProductPictures.FirstOrDefault()?.PictureId))- {- imageUrl = await _pictureService.GetPictureUrl(product.ProductPictures.FirstOrDefault()?.PictureId, showDefaultPicture: false, storeLocation: storeLocation);- }- }- products.Add(new SitemapUrl(url, imageUrl, UpdateFrequency.Weekly, product.UpdatedOnUtc ?? product.CreatedOnUtc));-- }- return products;-+ var url =+ _appConfig.SeoFriendlyUrlsForLanguagesEnabled+ ? _linkGenerator.GetUriByRouteValues("Brand",+ new { SeName = brand.GetSeName(language.Id), language = language.UniqueSeoCode },+ GetHttpProtocol(), GetHost())+ : _linkGenerator.GetUriByRouteValues("Brand", new { SeName = brand.GetSeName(language.Id) },+ GetHttpProtocol(), GetHost());++ var imageUrl = string.Empty;+ if (_commonSettings.SitemapIncludeImage)+ if (!string.IsNullOrEmpty(brand.PictureId))+ imageUrl = await _pictureService.GetPictureUrl(brand.PictureId, showDefaultPicture: false,+ storeLocation: storeLocation);+ brandUrls.Add(new SitemapUrl(url, imageUrl, UpdateFrequency.Weekly,+ brand.UpdatedOnUtc ?? brand.CreatedOnUtc));}- private async Task<IEnumerable<SitemapUrl>> GetPagesUrls(Language language, Store store)+ return brandUrls;+ }++ private async Task<IEnumerable<SitemapUrl>> GetProductUrls(Language language, Store store)+ {+ var search = await _productService.SearchProducts(storeId: store.Id,+ visibleIndividuallyOnly: true, orderBy: ProductSortingEnum.CreatedOn);+ var storeLocation = GetStoreLocation();+ var products = new List<SitemapUrl>();+ foreach (var product in search.products){- var now = DateTime.UtcNow;- return (await _pageService.GetAllPages(storeId: store.Id))- .Where(t => t.IncludeInSitemap && (!t.StartDateUtc.HasValue || t.StartDateUtc < now) && (!t.EndDateUtc.HasValue || t.EndDateUtc > now))- .Select(topic =>- {- var url =- _appConfig.SeoFriendlyUrlsForLanguagesEnabled ?- _linkGenerator.GetUriByRouteValues("Topic", new { SeName = topic.GetSeName(language.Id), language = language.UniqueSeoCode }, GetHttpProtocol(), GetHost())- :- _linkGenerator.GetUriByRouteValues("Topic", new { SeName = topic.GetSeName(language.Id) }, GetHttpProtocol(), GetHost());-- return new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow);- });+ var url =+ _appConfig.SeoFriendlyUrlsForLanguagesEnabled+ ? _linkGenerator.GetUriByRouteValues("Product",+ new { SeName = product.GetSeName(language.Id), language = language.UniqueSeoCode },+ GetHttpProtocol(), GetHost())+ : _linkGenerator.GetUriByRouteValues("Product", new { SeName = product.GetSeName(language.Id) },+ GetHttpProtocol(), GetHost());++ var imageUrl = string.Empty;+ if (_commonSettings.SitemapIncludeImage)+ if (!string.IsNullOrEmpty(product.ProductPictures.FirstOrDefault()?.PictureId))+ imageUrl = await _pictureService.GetPictureUrl(product.ProductPictures.FirstOrDefault()?.PictureId,+ showDefaultPicture: false, storeLocation: storeLocation);+ products.Add(new SitemapUrl(url, imageUrl, UpdateFrequency.Weekly,+ product.UpdatedOnUtc ?? product.CreatedOnUtc));}- private async Task<IEnumerable<SitemapUrl>> GetBlogPostsUrls(Language language, Store store)- {- var blogposts = await _blogService.GetAllBlogPosts(storeId: store.Id);- var blog = new List<SitemapUrl>();- var storeLocation = GetStoreLocation();- foreach (var blogpost in blogposts)+ return products;+ }++ private async Task<IEnumerable<SitemapUrl>> GetPagesUrls(Language language, Store store)+ {+ var now = DateTime.UtcNow;+ return (await _pageService.GetAllPages(store.Id))+ .Where(t => t.IncludeInSitemap && (!t.StartDateUtc.HasValue || t.StartDateUtc < now) &&+ (!t.EndDateUtc.HasValue || t.EndDateUtc > now))+ .Select(topic =>{var url =- _appConfig.SeoFriendlyUrlsForLanguagesEnabled ?- _linkGenerator.GetUriByRouteValues("BlogPost", new { SeName = blogpost.GetSeName(language.Id), language = language.UniqueSeoCode }, GetHttpProtocol(), GetHost())- :- _linkGenerator.GetUriByRouteValues("BlogPost", new { SeName = blogpost.GetSeName(language.Id) }, GetHttpProtocol(), GetHost());-- var imageurl = string.Empty;- if (_commonSettings.SitemapIncludeImage)- {- if (!string.IsNullOrEmpty(blogpost.PictureId))- {- imageurl = await _pictureService.GetPictureUrl(blogpost.PictureId, showDefaultPicture: false, storeLocation: storeLocation);- }- }- blog.Add(new SitemapUrl(url, imageurl, UpdateFrequency.Weekly, DateTime.UtcNow));- }-- return blog;- }+ _appConfig.SeoFriendlyUrlsForLanguagesEnabled+ ? _linkGenerator.GetUriByRouteValues("Topic",+ new { SeName = topic.GetSeName(language.Id), language = language.UniqueSeoCode },+ GetHttpProtocol(), GetHost())+ : _linkGenerator.GetUriByRouteValues("Topic", new { SeName = topic.GetSeName(language.Id) },+ GetHttpProtocol(), GetHost());++ return new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow);+ });+ }- private async Task<IEnumerable<SitemapUrl>> GetKnowledgebaseUrls(Language language)+ private async Task<IEnumerable<SitemapUrl>> GetBlogPostsUrls(Language language, Store store)+ {+ var blogposts = await _blogService.GetAllBlogPosts(store.Id);+ var blog = new List<SitemapUrl>();+ var storeLocation = GetStoreLocation();+ foreach (var blogpost in blogposts){- var knowledgebasearticles = await _knowledgebaseService.GetPublicKnowledgebaseArticles();-- return knowledgebasearticles.Select(knowledgebasearticle => _appConfig.SeoFriendlyUrlsForLanguagesEnabled- ? _linkGenerator.GetUriByRouteValues("KnowledgebaseArticle", new { SeName = knowledgebasearticle.GetSeName(language.Id), language = language.UniqueSeoCode }, GetHttpProtocol(), GetHost())- : _linkGenerator.GetUriByRouteValues("KnowledgebaseArticle", new { SeName = knowledgebasearticle.GetSeName(language.Id) }, GetHttpProtocol(), GetHost()))- .Select(url => new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow))- .ToList();+ var url =+ _appConfig.SeoFriendlyUrlsForLanguagesEnabled+ ? _linkGenerator.GetUriByRouteValues("BlogPost",+ new { SeName = blogpost.GetSeName(language.Id), language = language.UniqueSeoCode },+ GetHttpProtocol(), GetHost())+ : _linkGenerator.GetUriByRouteValues("BlogPost", new { SeName = blogpost.GetSeName(language.Id) },+ GetHttpProtocol(), GetHost());++ var imageurl = string.Empty;+ if (_commonSettings.SitemapIncludeImage)+ if (!string.IsNullOrEmpty(blogpost.PictureId))+ imageurl = await _pictureService.GetPictureUrl(blogpost.PictureId, showDefaultPicture: false,+ storeLocation: storeLocation);+ blog.Add(new SitemapUrl(url, imageurl, UpdateFrequency.Weekly, DateTime.UtcNow));}- private IEnumerable<SitemapUrl> GetCustomUrls()- {- var storeLocation = GetStoreLocation();+ return blog;+ }- return _commonSettings.SitemapCustomUrls.Select(customUrl =>- new SitemapUrl(string.Concat(storeLocation, customUrl), string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow));- }+ private async Task<IEnumerable<SitemapUrl>> GetKnowledgebaseUrls(Language language)+ {+ var knowledgebasearticles = await _knowledgebaseService.GetPublicKnowledgebaseArticles();++ return knowledgebasearticles.Select(knowledgebasearticle => _appConfig.SeoFriendlyUrlsForLanguagesEnabled+ ? _linkGenerator.GetUriByRouteValues("KnowledgebaseArticle",+ new { SeName = knowledgebasearticle.GetSeName(language.Id), language = language.UniqueSeoCode },+ GetHttpProtocol(), GetHost())+ : _linkGenerator.GetUriByRouteValues("KnowledgebaseArticle",+ new { SeName = knowledgebasearticle.GetSeName(language.Id) }, GetHttpProtocol(), GetHost()))+ .Select(url => new SitemapUrl(url, string.Empty, UpdateFrequency.Weekly, DateTime.UtcNow))+ .ToList();+ }- private string XmlEncode(string str)- {- if (str == null)- return null;- str = Regex.Replace(str, @"[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD]", "", RegexOptions.Compiled);- if (string.IsNullOrEmpty(str))- return null;+ private IEnumerable<SitemapUrl> GetCustomUrls()+ {+ var storeLocation = GetStoreLocation();- var xwSettings = new XmlWriterSettings- {- ConformanceLevel = ConformanceLevel.Auto- };- using var sw = new StringWriter();- using var xwr = XmlWriter.Create(sw, xwSettings);- xwr.WriteString(str);- xwr.Flush();- return sw.ToString();- }+ return _commonSettings.SitemapCustomUrls.Select(customUrl =>+ new SitemapUrl(string.Concat(storeLocation, customUrl), string.Empty, UpdateFrequency.Weekly,+ DateTime.UtcNow));+ }+ private string XmlEncode(string str)+ {+ if (str == null)+ return null;+ str = Regex.Replace(str, @"[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD]", "", RegexOptions.Compiled);+ if (string.IsNullOrEmpty(str))+ return null;++ var xwSettings = new XmlWriterSettings {+ ConformanceLevel = ConformanceLevel.Auto+ };+ using var sw = new StringWriter();+ using var xwr = XmlWriter.Create(sw, xwSettings);+ xwr.WriteString(str);+ xwr.Flush();+ return sw.ToString();+ }- private async Task WriteSitemap(Stream stream, IList<SitemapUrl> sitemapUrls)- {- var xwSettings = new XmlWriterSettings- {- ConformanceLevel = ConformanceLevel.Auto,- Indent = true,- IndentChars = "\t",- NewLineChars = "\r\n",- Encoding = Encoding.UTF8,- Async = true- };-- await using var writer = XmlWriter.Create(stream, xwSettings);- await writer.WriteStartDocumentAsync();- writer.WriteStartElement("urlset");- await writer.WriteAttributeStringAsync("urlset", "xmlns", null, "http://www.sitemaps.org/schemas/sitemap/0.9");- if (_commonSettings.SitemapIncludeImage)- await writer.WriteAttributeStringAsync("xmlns", "image", null, "http://www.google.com/schemas/sitemap-image/1.1");-- await writer.WriteAttributeStringAsync("xsi", "schemaLocation", null, "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd");+ private async Task WriteSitemap(Stream stream, IList<SitemapUrl> sitemapUrls)+ {+ var xwSettings = new XmlWriterSettings {+ ConformanceLevel = ConformanceLevel.Auto,+ Indent = true,+ IndentChars = "\t",+ NewLineChars = "\r\n",+ Encoding = Encoding.UTF8,+ Async = true+ };++ await using var writer = XmlWriter.Create(stream, xwSettings);+ await writer.WriteStartDocumentAsync();+ writer.WriteStartElement("urlset");+ await writer.WriteAttributeStringAsync("urlset", "xmlns", null, "http://www.sitemaps.org/schemas/sitemap/0.9");++ if (_commonSettings.SitemapIncludeImage)+ await writer.WriteAttributeStringAsync("xmlns", "image", null,+ "http://www.google.com/schemas/sitemap-image/1.1");++ await writer.WriteAttributeStringAsync("xsi", "schemaLocation", null,+ "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd");++ foreach (var url in sitemapUrls)+ {+ writer.WriteStartElement("url");+ var location = XmlEncode(url.Location);+ writer.WriteElementString("loc", location);- foreach (var url in sitemapUrls)+ if (_commonSettings.SitemapIncludeImage && !string.IsNullOrEmpty(url.Image)){- writer.WriteStartElement("url");- var location = XmlEncode(url.Location);- writer.WriteElementString("loc", location);-- if (_commonSettings.SitemapIncludeImage && !string.IsNullOrEmpty(url.Image))- {- writer.WriteStartElement("image", "image", null);- writer.WriteElementString("image", "loc", null, url.Image);- writer.WriteEndElement();- }-- writer.WriteElementString("changefreq", url.UpdateFrequency.ToString().ToLowerInvariant());- writer.WriteElementString("lastmod", url.UpdatedOn.ToString(DateFormat));+ writer.WriteStartElement("image", "image", null);+ writer.WriteElementString("image", "loc", null, url.Image);writer.WriteEndElement();}- await writer.WriteEndElementAsync();- await writer.FlushAsync();+ writer.WriteElementString("changefreq", url.UpdateFrequency.ToString().ToLowerInvariant());+ writer.WriteElementString("lastmod", url.UpdatedOn.ToString(DateFormat));+ writer.WriteEndElement();}+ await writer.WriteEndElementAsync();+ await writer.FlushAsync();}/// <summary>- /// Represents a sitemap update frequency+ /// Represents sitemap URL/// </summary>- public enum UpdateFrequency+ private class SitemapUrl{+ public SitemapUrl(string location, string image, UpdateFrequency frequency, DateTime updatedOn)+ {+ Location = location;+ Image = image;+ UpdateFrequency = frequency;+ UpdatedOn = updatedOn;+ }+/// <summary>- /// Always- /// </summary>- Always,- /// <summary>- /// Hourly- /// </summary>- Hourly,- /// <summary>- /// Daily- /// </summary>- Daily,- /// <summary>- /// Weekly+ /// Gets or sets URL of the page/// </summary>- Weekly,+ public string Location { get; }+/// <summary>- /// Monthly+ /// Gets or sets URL of the image/// </summary>- Monthly,+ public string Image { get; }+/// <summary>- /// Yearly+ /// Gets or sets a value indicating how frequently the page is likely to change/// </summary>- Yearly,+ public UpdateFrequency UpdateFrequency { get; }+/// <summary>- /// Never+ /// Gets or sets the date of last modification of the file/// </summary>- Never+ public DateTime UpdatedOn { get; }}}++/// <summary>+/// Represents a sitemap update frequency+/// </summary>+public enum UpdateFrequency+{+ /// <summary>+ /// Always+ /// </summary>+ Always,++ /// <summary>+ /// Hourly+ /// </summary>+ Hourly,++ /// <summary>+ /// Daily+ /// </summary>+ Daily,++ /// <summary>+ /// Weekly+ /// </summary>+ Weekly,++ /// <summary>+ /// Monthly+ /// </summary>+ Monthly,++ /// <summary>+ /// Yearly+ /// </summary>+ Yearly,++ /// <summary>+ /// Never+ /// </summary>+ Never+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAttributeCombinationTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAttributeCombinationTokensCommandHandler.csindex ead211cfc..72735f7df 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAttributeCombinationTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAttributeCombinationTokensCommandHandler.cs@@ -4,25 +4,28 @@ using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using Grand.Domain.Catalog;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class+ GetAttributeCombinationTokensCommandHandler : IRequestHandler<GetAttributeCombinationTokensCommand,+ LiquidAttributeCombination>{- public class GetAttributeCombinationTokensCommandHandler : IRequestHandler<GetAttributeCombinationTokensCommand, LiquidAttributeCombination>- {- private readonly IProductAttributeFormatter _productAttributeFormatter;+ private readonly IProductAttributeFormatter _productAttributeFormatter;- public GetAttributeCombinationTokensCommandHandler(- IProductAttributeFormatter productAttributeFormatter)- {- _productAttributeFormatter = productAttributeFormatter;- }+ public GetAttributeCombinationTokensCommandHandler(+ IProductAttributeFormatter productAttributeFormatter)+ {+ _productAttributeFormatter = productAttributeFormatter;+ }- public async Task<LiquidAttributeCombination> Handle(GetAttributeCombinationTokensCommand request, CancellationToken cancellationToken)- {- var liquidAttributeCombination = new LiquidAttributeCombination(request.Combination) {- Formatted = await _productAttributeFormatter.FormatAttributes(request.Product, request.Combination.Attributes, null, renderPrices: false),- SKU = request.Product.FormatSku(request.Combination.Attributes)- };- return liquidAttributeCombination;- }+ public async Task<LiquidAttributeCombination> Handle(GetAttributeCombinationTokensCommand request,+ CancellationToken cancellationToken)+ {+ var liquidAttributeCombination = new LiquidAttributeCombination(request.Combination) {+ Formatted = await _productAttributeFormatter.FormatAttributes(request.Product,+ request.Combination.Attributes, null, renderPrices: false),+ SKU = request.Product.FormatSku(request.Combination.Attributes)+ };+ return liquidAttributeCombination;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAuctionTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAuctionTokensCommandHandler.csindex cc9d34fca..84d408e4d 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAuctionTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetAuctionTokensCommandHandler.cs@@ -1,35 +1,36 @@-using Grand.Business.Core.Interfaces.Catalog.Prices;+using Grand.Business.Core.Commands.Messages.Tokens;+using Grand.Business.Core.Interfaces.Catalog.Prices;using Grand.Business.Core.Interfaces.Common.Directory;-using Grand.Business.Core.Commands.Messages.Tokens;using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using MediatR;using System.Globalization;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class GetAuctionTokensCommandHandler : IRequestHandler<GetAuctionTokensCommand, LiquidAuctions>{- public class GetAuctionTokensCommandHandler : IRequestHandler<GetAuctionTokensCommand, LiquidAuctions>- {- private readonly ICurrencyService _currencyService;- private readonly IPriceFormatter _priceFormatter;- private readonly IDateTimeService _dateTimeService;+ private readonly ICurrencyService _currencyService;+ private readonly IDateTimeService _dateTimeService;+ private readonly IPriceFormatter _priceFormatter;- public GetAuctionTokensCommandHandler(- ICurrencyService currencyService,- IPriceFormatter priceFormatter,- IDateTimeService dateTimeService)- {- _currencyService = currencyService;- _priceFormatter = priceFormatter;- _dateTimeService = dateTimeService;- }+ public GetAuctionTokensCommandHandler(+ ICurrencyService currencyService,+ IPriceFormatter priceFormatter,+ IDateTimeService dateTimeService)+ {+ _currencyService = currencyService;+ _priceFormatter = priceFormatter;+ _dateTimeService = dateTimeService;+ }- public async Task<LiquidAuctions> Handle(GetAuctionTokensCommand request, CancellationToken cancellationToken)- {- var liquidAuctions = new LiquidAuctions(request.Product, request.Bid);- var defaultCurrency = await _currencyService.GetPrimaryStoreCurrency();- liquidAuctions.Price = _priceFormatter.FormatPrice(request.Bid.Amount, defaultCurrency);- liquidAuctions.EndTime = _dateTimeService.ConvertToUserTime(request.Product.AvailableEndDateTimeUtc.Value, DateTimeKind.Utc).ToString(CultureInfo.InvariantCulture);- return liquidAuctions;- }+ public async Task<LiquidAuctions> Handle(GetAuctionTokensCommand request, CancellationToken cancellationToken)+ {+ var liquidAuctions = new LiquidAuctions(request.Product, request.Bid);+ var defaultCurrency = await _currencyService.GetPrimaryStoreCurrency();+ liquidAuctions.Price = _priceFormatter.FormatPrice(request.Bid.Amount, defaultCurrency);+ liquidAuctions.EndTime = _dateTimeService+ .ConvertToUserTime(request.Product.AvailableEndDateTimeUtc.Value, DateTimeKind.Utc)+ .ToString(CultureInfo.InvariantCulture);+ return liquidAuctions;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetGiftVoucherTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetGiftVoucherTokensCommandHandler.csindex 420da7317..44de20e31 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetGiftVoucherTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetGiftVoucherTokensCommandHandler.cs@@ -1,28 +1,29 @@-using Grand.Business.Core.Interfaces.Catalog.Prices;-using Grand.Business.Core.Commands.Messages.Tokens;+using Grand.Business.Core.Commands.Messages.Tokens;+using Grand.Business.Core.Interfaces.Catalog.Prices;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class GetGiftVoucherTokensCommandHandler : IRequestHandler<GetGiftVoucherTokensCommand, LiquidGiftVoucher>{- public class GetGiftVoucherTokensCommandHandler : IRequestHandler<GetGiftVoucherTokensCommand, LiquidGiftVoucher>+ private readonly ICurrencyService _currencyService;+ private readonly IPriceFormatter _priceFormatter;++ public GetGiftVoucherTokensCommandHandler(IPriceFormatter priceFormatter, ICurrencyService currencyService){- private readonly IPriceFormatter _priceFormatter;- private readonly ICurrencyService _currencyService;- public GetGiftVoucherTokensCommandHandler(IPriceFormatter priceFormatter, ICurrencyService currencyService)- {- _priceFormatter = priceFormatter;- _currencyService = currencyService;- }+ _priceFormatter = priceFormatter;+ _currencyService = currencyService;+ }- public async Task<LiquidGiftVoucher> Handle(GetGiftVoucherTokensCommand request, CancellationToken cancellationToken)- {- var liquidGiftCart = new LiquidGiftVoucher(request.GiftVoucher)- {- Amount = _priceFormatter.FormatPrice(request.GiftVoucher.Amount, await _currencyService.GetCurrencyByCode(request.GiftVoucher.CurrencyCode))- };- return await Task.FromResult(liquidGiftCart);- }+ public async Task<LiquidGiftVoucher> Handle(GetGiftVoucherTokensCommand request,+ CancellationToken cancellationToken)+ {+ var liquidGiftCart = new LiquidGiftVoucher(request.GiftVoucher) {+ Amount = _priceFormatter.FormatPrice(request.GiftVoucher.Amount,+ await _currencyService.GetCurrencyByCode(request.GiftVoucher.CurrencyCode))+ };+ return await Task.FromResult(liquidGiftCart);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetMerchandiseReturnTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetMerchandiseReturnTokensCommandHandler.csindex 754e84e38..5d2d56c3c 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetMerchandiseReturnTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetMerchandiseReturnTokensCommandHandler.cs@@ -1,52 +1,59 @@-using Grand.Business.Core.Interfaces.Catalog.Products;+using Grand.Business.Core.Commands.Messages.Tokens;using Grand.Business.Core.Extensions;+using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Common.Directory;-using Grand.Business.Core.Commands.Messages.Tokens;using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Messages-{- public class GetMerchandiseReturnTokensCommandHandler : IRequestHandler<GetMerchandiseReturnTokensCommand, LiquidMerchandiseReturn>- {- private readonly ICountryService _countryService;- private readonly IProductService _productService;-- public GetMerchandiseReturnTokensCommandHandler(- ICountryService countryService,- IProductService productService)- {- _countryService = countryService;- _productService = productService;- }+namespace Grand.Business.System.Commands.Handlers.Messages;- public async Task<LiquidMerchandiseReturn> Handle(GetMerchandiseReturnTokensCommand request, CancellationToken cancellationToken)- {- var liquidMerchandiseReturn = new LiquidMerchandiseReturn(request.MerchandiseReturn, request.Store, request.Host, request.Order, request.MerchandiseReturnNote);+public class+ GetMerchandiseReturnTokensCommandHandler : IRequestHandler<GetMerchandiseReturnTokensCommand,+ LiquidMerchandiseReturn>+{+ private readonly ICountryService _countryService;+ private readonly IProductService _productService;- var country = await _countryService.GetCountryById(request.MerchandiseReturn.PickupAddress.CountryId);+ public GetMerchandiseReturnTokensCommandHandler(+ ICountryService countryService,+ IProductService productService)+ {+ _countryService = countryService;+ _productService = productService;+ }- liquidMerchandiseReturn.Status = request.MerchandiseReturn.MerchandiseReturnStatus.ToString();+ public async Task<LiquidMerchandiseReturn> Handle(GetMerchandiseReturnTokensCommand request,+ CancellationToken cancellationToken)+ {+ var liquidMerchandiseReturn = new LiquidMerchandiseReturn(request.MerchandiseReturn, request.Store,+ request.Host, request.Order, request.MerchandiseReturnNote);- liquidMerchandiseReturn.PickupAddressStateProvince =- !string.IsNullOrEmpty(request.MerchandiseReturn.PickupAddress.StateProvinceId) ?- country?.StateProvinces.FirstOrDefault(x => x.Id == request.MerchandiseReturn.PickupAddress.StateProvinceId)?.GetTranslation(x => x.Name, request.Language.Id) : "";+ var country = await _countryService.GetCountryById(request.MerchandiseReturn.PickupAddress.CountryId);- liquidMerchandiseReturn.PickupAddressCountry =- !string.IsNullOrEmpty(request.MerchandiseReturn.PickupAddress.CountryId) ?- country?.GetTranslation(x => x.Name, request.Language.Id) : "";+ liquidMerchandiseReturn.Status = request.MerchandiseReturn.MerchandiseReturnStatus.ToString();- foreach (var merchandiseReturnItem in request.MerchandiseReturn.MerchandiseReturnItems)- {- var orderItem = request.Order.OrderItems.Where(x => x.Id == merchandiseReturnItem.OrderItemId).First();- var product = await _productService.GetProductById(orderItem.ProductId);- var liquidItem = new LiquidMerchandiseReturnItem(merchandiseReturnItem, orderItem, product, request.Order.CustomerLanguageId);+ liquidMerchandiseReturn.PickupAddressStateProvince =+ !string.IsNullOrEmpty(request.MerchandiseReturn.PickupAddress.StateProvinceId)+ ? country?.StateProvinces+ .FirstOrDefault(x => x.Id == request.MerchandiseReturn.PickupAddress.StateProvinceId)+ ?.GetTranslation(x => x.Name, request.Language.Id)+ : "";- liquidMerchandiseReturn.Items.Add(liquidItem);- }+ liquidMerchandiseReturn.PickupAddressCountry =+ !string.IsNullOrEmpty(request.MerchandiseReturn.PickupAddress.CountryId)+ ? country?.GetTranslation(x => x.Name, request.Language.Id)+ : "";- return liquidMerchandiseReturn;+ foreach (var merchandiseReturnItem in request.MerchandiseReturn.MerchandiseReturnItems)+ {+ var orderItem = request.Order.OrderItems.Where(x => x.Id == merchandiseReturnItem.OrderItemId).First();+ var product = await _productService.GetProductById(orderItem.ProductId);+ var liquidItem = new LiquidMerchandiseReturnItem(merchandiseReturnItem, orderItem, product,+ request.Order.CustomerLanguageId);+ liquidMerchandiseReturn.Items.Add(liquidItem);}++ return liquidMerchandiseReturn;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.csindex 866aec11b..52d5ebd29 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.cs@@ -12,240 +12,269 @@ using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using Grand.Domain.Catalog;using Grand.Domain.Orders;using Grand.Domain.Tax;-using Grand.Domain.Vendors;using MediatR;using System.Globalization;using System.Net;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class GetOrderTokensCommandHandler : IRequestHandler<GetOrderTokensCommand, LiquidOrder>{- public class GetOrderTokensCommandHandler : IRequestHandler<GetOrderTokensCommand, LiquidOrder>+ private readonly IAddressAttributeParser _addressAttributeParser;+ private readonly ICountryService _countryService;+ private readonly ICurrencyService _currencyService;+ private readonly IGiftVoucherService _giftVoucherService;+ private readonly ILanguageService _languageService;+ private readonly IPaymentService _paymentService;+ private readonly IPriceFormatter _priceFormatter;+ private readonly IProductService _productService;++ private readonly TaxSettings _taxSettings;+ private readonly IVendorService _vendorService;++ public GetOrderTokensCommandHandler(+ ILanguageService languageService,+ ICurrencyService currencyService,+ IProductService productService,+ IVendorService vendorService,+ IPriceFormatter priceFormatter,+ ICountryService countryService,+ IAddressAttributeParser addressAttributeParser,+ IPaymentService paymentService,+ IGiftVoucherService giftVoucherService,+ TaxSettings taxSettings){- private readonly ILanguageService _languageService;- private readonly ICurrencyService _currencyService;- private readonly IProductService _productService;- private readonly IVendorService _vendorService;- private readonly IPriceFormatter _priceFormatter;- private readonly ICountryService _countryService;- private readonly IAddressAttributeParser _addressAttributeParser;- private readonly IPaymentService _paymentService;- private readonly IGiftVoucherService _giftVoucherService;-- private readonly TaxSettings _taxSettings;-- public GetOrderTokensCommandHandler(- ILanguageService languageService,- ICurrencyService currencyService,- IProductService productService,- IVendorService vendorService,- IPriceFormatter priceFormatter,- ICountryService countryService,- IAddressAttributeParser addressAttributeParser,- IPaymentService paymentService,- IGiftVoucherService giftVoucherService,- TaxSettings taxSettings)- {- _languageService = languageService;- _currencyService = currencyService;- _productService = productService;- _vendorService = vendorService;- _priceFormatter = priceFormatter;- _countryService = countryService;- _addressAttributeParser = addressAttributeParser;- _paymentService = paymentService;- _giftVoucherService = giftVoucherService;- _taxSettings = taxSettings;- }+ _languageService = languageService;+ _currencyService = currencyService;+ _productService = productService;+ _vendorService = vendorService;+ _priceFormatter = priceFormatter;+ _countryService = countryService;+ _addressAttributeParser = addressAttributeParser;+ _paymentService = paymentService;+ _giftVoucherService = giftVoucherService;+ _taxSettings = taxSettings;+ }++ public async Task<LiquidOrder> Handle(GetOrderTokensCommand request, CancellationToken cancellationToken)+ {+ var language = await _languageService.GetLanguageById(request.Order.CustomerLanguageId);+ var currency = await _currencyService.GetCurrencyByCode(request.Order.CustomerCurrencyCode);- public async Task<LiquidOrder> Handle(GetOrderTokensCommand request, CancellationToken cancellationToken)+ var liquidOrder = new LiquidOrder(request.Order, request.Customer, language, currency, request.Store,+ request.Host, request.OrderNote, request.Vendor);+ foreach (var item in request.Order.OrderItems.Where(x =>+ x.VendorId == request.Vendor?.Id || request.Vendor == null)){- var language = await _languageService.GetLanguageById(request.Order.CustomerLanguageId);- var currency = await _currencyService.GetCurrencyByCode(request.Order.CustomerCurrencyCode);+ var product = await _productService.GetProductById(item.ProductId);+ var vendorItem = string.IsNullOrEmpty(item.VendorId)+ ? null+ : await _vendorService.GetVendorById(item.VendorId);+ var liquidItem = new LiquidOrderItem(item, product, language, request.Store, request.Host, vendorItem);- var liquidOrder = new LiquidOrder(request.Order, request.Customer, language, currency, request.Store, request.Host, request.OrderNote, request.Vendor);- foreach (var item in request.Order.OrderItems.Where(x => x.VendorId == request.Vendor?.Id || request.Vendor == null))- {- var product = await _productService.GetProductById(item.ProductId);- Vendor vendorItem = string.IsNullOrEmpty(item.VendorId) ? null : await _vendorService.GetVendorById(item.VendorId);- var liquidItem = new LiquidOrderItem(item, product, language, request.Store, request.Host, vendorItem);+ #region Download- #region Download+ liquidItem.IsDownloadAllowed = request.Order.IsDownloadAllowed(item, product);+ liquidItem.IsLicenseDownloadAllowed = request.Order.IsLicenseDownloadAllowed(item, product);- liquidItem.IsDownloadAllowed = request.Order.IsDownloadAllowed(item, product);- liquidItem.IsLicenseDownloadAllowed = request.Order.IsLicenseDownloadAllowed(item, product);+ #endregion- #endregion+ #region Unit price- #region Unit price-- liquidItem.UnitPrice = _priceFormatter.FormatPrice(item.UnitPriceInclTax, currency);- liquidItem.UnitPriceWithTax = request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax;-- #endregion+ liquidItem.UnitPrice = _priceFormatter.FormatPrice(item.UnitPriceInclTax, currency);+ liquidItem.UnitPriceWithTax = request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax;- #region total price-- liquidItem.TotalPrice = _priceFormatter.FormatPrice(item.PriceInclTax, currency);- liquidItem.TotalPriceWithTax = request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax;-- #endregion+ #endregion- var sku = "";- if (product != null)- sku = product.FormatSku(item.Attributes);+ #region total price- liquidItem.ProductSku = WebUtility.HtmlEncode(sku);- liquidOrder.OrderItems.Add(liquidItem);- }- var billingCountry = await _countryService.GetCountryById(request.Order.BillingAddress?.CountryId);- liquidOrder.BillingCustomAttributes = await _addressAttributeParser.FormatAttributes(language, request.Order.BillingAddress?.Attributes);- liquidOrder.BillingCountry = request.Order.BillingAddress != null && !string.IsNullOrEmpty(request.Order.BillingAddress.CountryId) ? billingCountry?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId) : "";- liquidOrder.BillingStateProvince = !string.IsNullOrEmpty(request.Order.BillingAddress?.StateProvinceId) ? billingCountry?.StateProvinces.FirstOrDefault(x => x.Id == request.Order.BillingAddress.StateProvinceId)?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId) : "";+ liquidItem.TotalPrice = _priceFormatter.FormatPrice(item.PriceInclTax, currency);+ liquidItem.TotalPriceWithTax = request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax;- var shippingCountry = await _countryService.GetCountryById(request.Order.ShippingAddress?.CountryId);- liquidOrder.ShippingCountry = request.Order.ShippingAddress != null && !string.IsNullOrEmpty(request.Order.ShippingAddress.CountryId) ? shippingCountry?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId) : "";- liquidOrder.ShippingStateProvince = request.Order.ShippingAddress != null && !string.IsNullOrEmpty(request.Order.ShippingAddress.StateProvinceId) ? shippingCountry?.StateProvinces.FirstOrDefault(x => x.Id == request.Order.ShippingAddress.StateProvinceId)?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId) : "";- liquidOrder.ShippingCustomAttributes = await _addressAttributeParser.FormatAttributes(language, request.Order.ShippingAddress?.Attributes);+ #endregion- var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(request.Order.PaymentMethodSystemName);- liquidOrder.PaymentMethod = paymentMethod != null ? paymentMethod.FriendlyName : request.Order.PaymentMethodSystemName;+ var sku = "";+ if (product != null)+ sku = product.FormatSku(item.Attributes);- var dict = new Dictionary<string, string>();- foreach (var item in request.Order.OrderTaxes)- {- var taxRate = _priceFormatter.FormatTaxRate(item.Percent);- var taxValue = _priceFormatter.FormatPrice(item.Amount);+ liquidItem.ProductSku = WebUtility.HtmlEncode(sku);+ liquidOrder.OrderItems.Add(liquidItem);+ }- if (string.IsNullOrEmpty(taxRate))- taxRate = item.Percent.ToString(CultureInfo.InvariantCulture);+ var billingCountry = await _countryService.GetCountryById(request.Order.BillingAddress?.CountryId);+ liquidOrder.BillingCustomAttributes =+ await _addressAttributeParser.FormatAttributes(language, request.Order.BillingAddress?.Attributes);+ liquidOrder.BillingCountry =+ request.Order.BillingAddress != null && !string.IsNullOrEmpty(request.Order.BillingAddress.CountryId)+ ? billingCountry?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId)+ : "";+ liquidOrder.BillingStateProvince = !string.IsNullOrEmpty(request.Order.BillingAddress?.StateProvinceId)+ ? billingCountry?.StateProvinces.FirstOrDefault(x => x.Id == request.Order.BillingAddress.StateProvinceId)+ ?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId)+ : "";- dict.TryAdd(taxRate, taxValue);- }+ var shippingCountry = await _countryService.GetCountryById(request.Order.ShippingAddress?.CountryId);+ liquidOrder.ShippingCountry =+ request.Order.ShippingAddress != null && !string.IsNullOrEmpty(request.Order.ShippingAddress.CountryId)+ ? shippingCountry?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId)+ : "";+ liquidOrder.ShippingStateProvince =+ request.Order.ShippingAddress != null &&+ !string.IsNullOrEmpty(request.Order.ShippingAddress.StateProvinceId)+ ? shippingCountry?.StateProvinces+ .FirstOrDefault(x => x.Id == request.Order.ShippingAddress.StateProvinceId)+ ?.GetTranslation(x => x.Name, request.Order.CustomerLanguageId)+ : "";+ liquidOrder.ShippingCustomAttributes =+ await _addressAttributeParser.FormatAttributes(language, request.Order.ShippingAddress?.Attributes);- liquidOrder.TaxRates = dict;+ var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(request.Order.PaymentMethodSystemName);+ liquidOrder.PaymentMethod =+ paymentMethod != null ? paymentMethod.FriendlyName : request.Order.PaymentMethodSystemName;- var cards = new Dictionary<string, string>();- var gcuhC = await _giftVoucherService.GetAllGiftVoucherUsageHistory(request.Order.Id);- foreach (var gcuh in gcuhC)- {- var giftVoucher = await _giftVoucherService.GetGiftVoucherById(gcuh.GiftVoucherId);- var giftVoucherText = WebUtility.HtmlEncode(giftVoucher.Code);- var giftVoucherAmount = _priceFormatter.FormatPrice(-gcuh.UsedValue, currency);- cards.Add(giftVoucherText, giftVoucherAmount);- }- liquidOrder.GiftVouchers = cards;- if (request.Order.RedeemedLoyaltyPoints > 0)- {- liquidOrder.RPPoints = request.Order.RedeemedLoyaltyPoints.ToString();- liquidOrder.RPAmount = _priceFormatter.FormatPrice(-request.Order.RedeemedLoyaltyPointsAmount, currency);- }- void CalculateSubTotals()+ var dict = new Dictionary<string, string>();+ foreach (var item in request.Order.OrderTaxes)+ {+ var taxRate = _priceFormatter.FormatTaxRate(item.Percent);+ var taxValue = _priceFormatter.FormatPrice(item.Amount);++ if (string.IsNullOrEmpty(taxRate))+ taxRate = item.Percent.ToString(CultureInfo.InvariantCulture);++ dict.TryAdd(taxRate, taxValue);+ }++ liquidOrder.TaxRates = dict;++ var cards = new Dictionary<string, string>();+ var gcuhC = await _giftVoucherService.GetAllGiftVoucherUsageHistory(request.Order.Id);+ foreach (var gcuh in gcuhC)+ {+ var giftVoucher = await _giftVoucherService.GetGiftVoucherById(gcuh.GiftVoucherId);+ var giftVoucherText = WebUtility.HtmlEncode(giftVoucher.Code);+ var giftVoucherAmount = _priceFormatter.FormatPrice(-gcuh.UsedValue, currency);+ cards.Add(giftVoucherText, giftVoucherAmount);+ }++ liquidOrder.GiftVouchers = cards;+ if (request.Order.RedeemedLoyaltyPoints > 0)+ {+ liquidOrder.RPPoints = request.Order.RedeemedLoyaltyPoints.ToString();+ liquidOrder.RPAmount = _priceFormatter.FormatPrice(-request.Order.RedeemedLoyaltyPointsAmount, currency);+ }++ void CalculateSubTotals()+ {+ string _cusSubTotal;+ bool _displaySubTotalDiscount;+ string _cusSubTotalDiscount;+ string _cusShipTotal;+ string _cusPaymentMethodAdditionalFee;+ bool _displayTax;+ string _cusTaxTotal;+ bool _displayTaxRates;+ bool _displayDiscount;+ string _cusDiscount;+ string _cusTotal;++ _displaySubTotalDiscount = false;+ _cusSubTotalDiscount = string.Empty;+ if (request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax &&+ !_taxSettings.ForceTaxExclusionFromOrderSubtotal){- string _cusSubTotal;- bool _displaySubTotalDiscount;- string _cusSubTotalDiscount;- string _cusShipTotal;- string _cusPaymentMethodAdditionalFee;- bool _displayTax;- string _cusTaxTotal;- bool _displayTaxRates;- bool _displayDiscount;- string _cusDiscount;- string _cusTotal;-- _displaySubTotalDiscount = false;- _cusSubTotalDiscount = string.Empty;- if (request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax && !_taxSettings.ForceTaxExclusionFromOrderSubtotal)+ //subtotal+ _cusSubTotal = _priceFormatter.FormatPrice(request.Order.OrderSubtotalInclTax, currency);+ //discount (applied to order subtotal)+ if (request.Order.OrderSubTotalDiscountInclTax > 0){- //subtotal- _cusSubTotal = _priceFormatter.FormatPrice(request.Order.OrderSubtotalInclTax, currency);- //discount (applied to order subtotal)- if (request.Order.OrderSubTotalDiscountInclTax > 0)- {- _cusSubTotalDiscount = _priceFormatter.FormatPrice(-request.Order.OrderSubTotalDiscountInclTax, currency);- _displaySubTotalDiscount = true;- }+ _cusSubTotalDiscount =+ _priceFormatter.FormatPrice(-request.Order.OrderSubTotalDiscountInclTax, currency);+ _displaySubTotalDiscount = true;}- else+ }+ else+ {+ //subtotal+ _cusSubTotal = _priceFormatter.FormatPrice(request.Order.OrderSubtotalExclTax, currency);+ //discount (applied to order subtotal)+ if (request.Order.OrderSubTotalDiscountExclTax > 0){- //subtotal- _cusSubTotal = _priceFormatter.FormatPrice(request.Order.OrderSubtotalExclTax, currency);- //discount (applied to order subtotal)- if (request.Order.OrderSubTotalDiscountExclTax > 0)- {- _cusSubTotalDiscount = _priceFormatter.FormatPrice(-request.Order.OrderSubTotalDiscountExclTax, currency);- _displaySubTotalDiscount = true;- }+ _cusSubTotalDiscount =+ _priceFormatter.FormatPrice(-request.Order.OrderSubTotalDiscountExclTax, currency);+ _displaySubTotalDiscount = true;}+ }- //shipping, payment method fee- _cusTaxTotal = string.Empty;- _cusDiscount = string.Empty;+ //shipping, payment method fee+ _cusTaxTotal = string.Empty;+ _cusDiscount = string.Empty;- if (request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax)- {- //shipping- _cusShipTotal = _priceFormatter.FormatPrice(request.Order.OrderShippingInclTax, currency);- //payment method additional fee- _cusPaymentMethodAdditionalFee = _priceFormatter.FormatPrice(request.Order.PaymentMethodAdditionalFeeInclTax, currency);- }- else- {- //shipping- _cusShipTotal = _priceFormatter.FormatPrice(request.Order.OrderShippingExclTax, currency);- //payment method additional fee- _cusPaymentMethodAdditionalFee = _priceFormatter.FormatPrice(request.Order.PaymentMethodAdditionalFeeExclTax, currency);- }- if (_taxSettings.HideTaxInOrderSummary && request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax)+ if (request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax)+ {+ //shipping+ _cusShipTotal = _priceFormatter.FormatPrice(request.Order.OrderShippingInclTax, currency);+ //payment method additional fee+ _cusPaymentMethodAdditionalFee =+ _priceFormatter.FormatPrice(request.Order.PaymentMethodAdditionalFeeInclTax, currency);+ }+ else+ {+ //shipping+ _cusShipTotal = _priceFormatter.FormatPrice(request.Order.OrderShippingExclTax, currency);+ //payment method additional fee+ _cusPaymentMethodAdditionalFee =+ _priceFormatter.FormatPrice(request.Order.PaymentMethodAdditionalFeeExclTax, currency);+ }++ if (_taxSettings.HideTaxInOrderSummary &&+ request.Order.CustomerTaxDisplayTypeId == TaxDisplayType.IncludingTax)+ {+ _displayTax = false;+ _displayTaxRates = false;+ }+ else+ {+ if (request.Order.OrderTax == 0 && _taxSettings.HideZeroTax){_displayTax = false;_displayTaxRates = false;}else{- if (request.Order.OrderTax == 0 && _taxSettings.HideZeroTax)- {- _displayTax = false;- _displayTaxRates = false;- }- else- {- _displayTaxRates = _taxSettings.DisplayTaxRates && request.Order.OrderTaxes.Any();- _displayTax = !_displayTaxRates;-- var taxStr = _priceFormatter.FormatPrice(request.Order.OrderTax, currency);- _cusTaxTotal = taxStr;- }- }+ _displayTaxRates = _taxSettings.DisplayTaxRates && request.Order.OrderTaxes.Any();+ _displayTax = !_displayTaxRates;- //discount- _displayDiscount = false;- if (request.Order.OrderDiscount > 0)- {- _cusDiscount = _priceFormatter.FormatPrice(-request.Order.OrderDiscount, currency);- _displayDiscount = true;+ var taxStr = _priceFormatter.FormatPrice(request.Order.OrderTax, currency);+ _cusTaxTotal = taxStr;}+ }- //total- _cusTotal = _priceFormatter.FormatPrice(request.Order.OrderTotal, currency);-- liquidOrder.SubTotal = _cusSubTotal;- liquidOrder.DisplaySubTotalDiscount = _displaySubTotalDiscount;- liquidOrder.SubTotalDiscount = _cusSubTotalDiscount;- liquidOrder.Shipping = _cusShipTotal;- liquidOrder.Discount = _cusDiscount;- liquidOrder.PaymentMethodAdditionalFee = _cusPaymentMethodAdditionalFee;- liquidOrder.Tax = _cusTaxTotal;- liquidOrder.Total = _cusTotal;- liquidOrder.DisplayTax = _displayTax;- liquidOrder.DisplayDiscount = _displayDiscount;- liquidOrder.DisplayTaxRates = _displayTaxRates;-+ //discount+ _displayDiscount = false;+ if (request.Order.OrderDiscount > 0)+ {+ _cusDiscount = _priceFormatter.FormatPrice(-request.Order.OrderDiscount, currency);+ _displayDiscount = true;}- CalculateSubTotals();+ //total+ _cusTotal = _priceFormatter.FormatPrice(request.Order.OrderTotal, currency);- return liquidOrder;+ liquidOrder.SubTotal = _cusSubTotal;+ liquidOrder.DisplaySubTotalDiscount = _displaySubTotalDiscount;+ liquidOrder.SubTotalDiscount = _cusSubTotalDiscount;+ liquidOrder.Shipping = _cusShipTotal;+ liquidOrder.Discount = _cusDiscount;+ liquidOrder.PaymentMethodAdditionalFee = _cusPaymentMethodAdditionalFee;+ liquidOrder.Tax = _cusTaxTotal;+ liquidOrder.Total = _cusTotal;+ liquidOrder.DisplayTax = _displayTax;+ liquidOrder.DisplayDiscount = _displayDiscount;+ liquidOrder.DisplayTaxRates = _displayTaxRates;}++ CalculateSubTotals();++ return liquidOrder;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShipmentTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShipmentTokensCommandHandler.csindex 87bf222b3..72c0a684a 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShipmentTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShipmentTokensCommandHandler.cs@@ -1,31 +1,33 @@-using Grand.Business.Core.Interfaces.Catalog.Products;-using Grand.Business.Core.Commands.Messages.Tokens;+using Grand.Business.Core.Commands.Messages.Tokens;+using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class GetShipmentTokensCommandHandler : IRequestHandler<GetShipmentTokensCommand, LiquidShipment>{- public class GetShipmentTokensCommandHandler : IRequestHandler<GetShipmentTokensCommand, LiquidShipment>+ private readonly IProductService _productService;++ public GetShipmentTokensCommandHandler(+ IProductService productService){- private readonly IProductService _productService;+ _productService = productService;+ }- public GetShipmentTokensCommandHandler(- IProductService productService)+ public async Task<LiquidShipment> Handle(GetShipmentTokensCommand request, CancellationToken cancellationToken)+ {+ var liquidShipment =+ new LiquidShipment(request.Shipment, request.Order, request.Store, request.Host, request.Language);+ foreach (var shipmentItem in request.Shipment.ShipmentItems){- _productService = productService;+ var orderItem = request.Order.OrderItems.FirstOrDefault(x => x.Id == shipmentItem.OrderItemId);+ var product = await _productService.GetProductById(shipmentItem.ProductId);+ var liquidShipmentItems = new LiquidShipmentItem(shipmentItem, request.Shipment, request.Order, orderItem,+ product, request.Language);+ liquidShipment.ShipmentItems.Add(liquidShipmentItems);}- public async Task<LiquidShipment> Handle(GetShipmentTokensCommand request, CancellationToken cancellationToken)- {- var liquidShipment = new LiquidShipment(request.Shipment, request.Order, request.Store, request.Host, request.Language);- foreach (var shipmentItem in request.Shipment.ShipmentItems)- {- var orderItem = request.Order.OrderItems.FirstOrDefault(x => x.Id == shipmentItem.OrderItemId);- var product = await _productService.GetProductById(shipmentItem.ProductId);- var liquidShipmentItems = new LiquidShipmentItem(shipmentItem, request.Shipment, request.Order, orderItem, product, request.Language);- liquidShipment.ShipmentItems.Add(liquidShipmentItems);- }- return liquidShipment;- }+ return liquidShipment;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShoppingCartTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShoppingCartTokensCommandHandler.csindex 07264a374..129d95cfe 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShoppingCartTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetShoppingCartTokensCommandHandler.cs@@ -1,65 +1,60 @@-using Grand.Business.Core.Interfaces.Catalog.Products;-using Grand.Business.Core.Commands.Messages.Tokens;-using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;+using Grand.Business.Core.Commands.Messages.Tokens;+using Grand.Business.Core.Interfaces.Catalog.Products;using Grand.Business.Core.Interfaces.Storage;+using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class GetShoppingCartTokensCommandHandler : IRequestHandler<GetShoppingCartTokensCommand, LiquidShoppingCart>{- public class GetShoppingCartTokensCommandHandler : IRequestHandler<GetShoppingCartTokensCommand, LiquidShoppingCart>+ private readonly IPictureService _pictureService;+ private readonly IProductAttributeFormatter _productAttributeFormatter;+ private readonly IProductService _productService;++ public GetShoppingCartTokensCommandHandler(+ IPictureService pictureService,+ IProductService productService,+ IProductAttributeFormatter productAttributeFormatter){- private readonly IPictureService _pictureService;- private readonly IProductService _productService;- private readonly IProductAttributeFormatter _productAttributeFormatter;+ _pictureService = pictureService;+ _productService = productService;+ _productAttributeFormatter = productAttributeFormatter;+ }- public GetShoppingCartTokensCommandHandler(- IPictureService pictureService,- IProductService productService,- IProductAttributeFormatter productAttributeFormatter)- {- _pictureService = pictureService;- _productService = productService;- _productAttributeFormatter = productAttributeFormatter;- }+ public async Task<LiquidShoppingCart> Handle(GetShoppingCartTokensCommand request,+ CancellationToken cancellationToken)+ {+ var liquidShoppingCart = new LiquidShoppingCart(request.Customer);+ await ProductList();- public async Task<LiquidShoppingCart> Handle(GetShoppingCartTokensCommand request,- CancellationToken cancellationToken)+ async Task ProductList(){- var liquidShoppingCart = new LiquidShoppingCart(request.Customer);- await ProductList();-- async Task ProductList()+ var attributeDescription = string.Empty;+ var pictureUrl = string.Empty;+ foreach (var item in request.Customer.ShoppingCartItems){- var attributeDescription = string.Empty;- var pictureUrl = string.Empty;- foreach (var item in request.Customer.ShoppingCartItems)- {- var product = await _productService.GetProductById(item.ProductId);+ var product = await _productService.GetProductById(item.ProductId);- if (product.ProductPictures.Any())- {- pictureUrl = await _pictureService.GetPictureUrl(- product.ProductPictures.MinBy(x => x.DisplayOrder)?.PictureId, 100,- storeLocation: request.Store.SslEnabled ? request.Store.SecureUrl : request.Store.Url);- }+ if (product.ProductPictures.Any())+ pictureUrl = await _pictureService.GetPictureUrl(+ product.ProductPictures.MinBy(x => x.DisplayOrder)?.PictureId, 100,+ storeLocation: request.Store.SslEnabled ? request.Store.SecureUrl : request.Store.Url);- //attributes- if (item.Attributes != null && item.Attributes.Any())- {- attributeDescription =- await _productAttributeFormatter.FormatAttributes(product, item.Attributes,- request.Customer);- }+ //attributes+ if (item.Attributes != null && item.Attributes.Any())+ attributeDescription =+ await _productAttributeFormatter.FormatAttributes(product, item.Attributes,+ request.Customer);- var result = new LiquidShoppingCartItem(product, attributeDescription, pictureUrl, item,- request.Language);+ var result = new LiquidShoppingCartItem(product, attributeDescription, pictureUrl, item,+ request.Language);- liquidShoppingCart.Items.Add(result);- }+ liquidShoppingCart.Items.Add(result);}-- return liquidShoppingCart;}++ return liquidShoppingCart;}}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetStoreTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetStoreTokensCommandHandler.csindex 13f7f2e8a..154df9937 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetStoreTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetStoreTokensCommandHandler.cs@@ -3,29 +3,27 @@ using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using Grand.Domain.Stores;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class GetStoreTokensCommandHandler : IRequestHandler<GetStoreTokensCommand, LiquidStore>{- public class GetStoreTokensCommandHandler : IRequestHandler<GetStoreTokensCommand, LiquidStore>- {- private readonly StoreInformationSettings _storeInformationSettings;+ private readonly StoreInformationSettings _storeInformationSettings;- public GetStoreTokensCommandHandler(StoreInformationSettings storeInformationSettings)- {- _storeInformationSettings = storeInformationSettings;- }+ public GetStoreTokensCommandHandler(StoreInformationSettings storeInformationSettings)+ {+ _storeInformationSettings = storeInformationSettings;+ }- public async Task<LiquidStore> Handle(GetStoreTokensCommand request, CancellationToken cancellationToken)- {- var liquidStore = new LiquidStore(request.Store, request.Language, request.EmailAccount)- {- TwitterLink = _storeInformationSettings.TwitterLink,- FacebookLink = _storeInformationSettings.FacebookLink,- YoutubeLink = _storeInformationSettings.YoutubeLink,- InstagramLink = _storeInformationSettings.InstagramLink,- LinkedInLink = _storeInformationSettings.LinkedInLink,- PinterestLink = _storeInformationSettings.PinterestLink- };- return await Task.FromResult(liquidStore);- }+ public async Task<LiquidStore> Handle(GetStoreTokensCommand request, CancellationToken cancellationToken)+ {+ var liquidStore = new LiquidStore(request.Store, request.Language, request.EmailAccount) {+ TwitterLink = _storeInformationSettings.TwitterLink,+ FacebookLink = _storeInformationSettings.FacebookLink,+ YoutubeLink = _storeInformationSettings.YoutubeLink,+ InstagramLink = _storeInformationSettings.InstagramLink,+ LinkedInLink = _storeInformationSettings.LinkedInLink,+ PinterestLink = _storeInformationSettings.PinterestLink+ };+ return await Task.FromResult(liquidStore);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetVendorTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetVendorTokensCommandHandler.csindex 04dcc5c99..0778fe661 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetVendorTokensCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetVendorTokensCommandHandler.cs@@ -1,32 +1,34 @@-using Grand.Business.Core.Extensions;+using Grand.Business.Core.Commands.Messages.Tokens;+using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;-using Grand.Business.Core.Commands.Messages.Tokens;using Grand.Business.Core.Utilities.Messages.DotLiquidDrops;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Messages+namespace Grand.Business.System.Commands.Handlers.Messages;++public class GetVendorTokensCommandHandler : IRequestHandler<GetVendorTokensCommand, LiquidVendor>{- public class GetVendorTokensCommandHandler : IRequestHandler<GetVendorTokensCommand, LiquidVendor>- {- private readonly ICountryService _countryService;+ private readonly ICountryService _countryService;- public GetVendorTokensCommandHandler(- ICountryService countryService)- {- _countryService = countryService;- }+ public GetVendorTokensCommandHandler(+ ICountryService countryService)+ {+ _countryService = countryService;+ }- public async Task<LiquidVendor> Handle(GetVendorTokensCommand request, CancellationToken cancellationToken)- {- var liquidVendor = new LiquidVendor(request.Vendor);- var country = await _countryService.GetCountryById(request.Vendor.Address.CountryId);- liquidVendor.StateProvince = !string.IsNullOrEmpty(request.Vendor.Address?.StateProvinceId) ?- country?.StateProvinces.FirstOrDefault(x=>x.Id == request.Vendor.Address.StateProvinceId)?.GetTranslation(x => x.Name, request.Language.Id) : "";+ public async Task<LiquidVendor> Handle(GetVendorTokensCommand request, CancellationToken cancellationToken)+ {+ var liquidVendor = new LiquidVendor(request.Vendor);+ var country = await _countryService.GetCountryById(request.Vendor.Address.CountryId);+ liquidVendor.StateProvince = !string.IsNullOrEmpty(request.Vendor.Address?.StateProvinceId)+ ? country?.StateProvinces.FirstOrDefault(x => x.Id == request.Vendor.Address.StateProvinceId)+ ?.GetTranslation(x => x.Name, request.Language.Id)+ : "";- liquidVendor.Country = !string.IsNullOrEmpty(request.Vendor.Address?.CountryId) ?- country?.GetTranslation(x => x.Name, request.Language.Id) : "";+ liquidVendor.Country = !string.IsNullOrEmpty(request.Vendor.Address?.CountryId)+ ? country?.GetTranslation(x => x.Name, request.Language.Id)+ : "";- return liquidVendor;- }+ return liquidVendor;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallNewPermissionsCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallNewPermissionsCommandHandler.csindex 92485618d..975bf00aa 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallNewPermissionsCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallNewPermissionsCommandHandler.cs@@ -1,53 +1,52 @@-using Grand.Business.Core.Extensions;+using Grand.Business.Core.Commands.System.Security;+using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Localization;using Grand.Business.Core.Interfaces.Common.Security;-using Grand.Business.Core.Commands.System.Security;using Grand.Domain.Permissions;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Security+namespace Grand.Business.System.Commands.Handlers.Security;++public class InstallNewPermissionsCommandHandler : IRequestHandler<InstallNewPermissionsCommand, bool>{- public class InstallNewPermissionsCommandHandler : IRequestHandler<InstallNewPermissionsCommand, bool>- {- private readonly IPermissionService _permissionService;- private readonly ITranslationService _translationService;- private readonly ILanguageService _languageService;+ private readonly ILanguageService _languageService;+ private readonly IPermissionService _permissionService;+ private readonly ITranslationService _translationService;- public InstallNewPermissionsCommandHandler(- IPermissionService permissionService,- ITranslationService translationService,- ILanguageService languageService)- {- _permissionService = permissionService;- _translationService = translationService;- _languageService = languageService;- }+ public InstallNewPermissionsCommandHandler(+ IPermissionService permissionService,+ ITranslationService translationService,+ ILanguageService languageService)+ {+ _permissionService = permissionService;+ _translationService = translationService;+ _languageService = languageService;+ }- public async Task<bool> Handle(InstallNewPermissionsCommand request, CancellationToken cancellationToken)+ public async Task<bool> Handle(InstallNewPermissionsCommand request, CancellationToken cancellationToken)+ {+ //install new permissions+ var permissions = request.PermissionProvider.GetPermissions();+ foreach (var permission in permissions){- //install new permissions- var permissions = request.PermissionProvider.GetPermissions();- foreach (var permission in permissions)- {- var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);- if (permission1 != null) continue;- //new permission (install it)- permission1 = new Permission- {- Name = permission.Name,- SystemName = permission.SystemName,- Area = permission.Area,- Category = permission.Category,- Actions = permission.Actions- };+ var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);+ if (permission1 != null) continue;+ //new permission (install it)+ permission1 = new Permission {+ Name = permission.Name,+ SystemName = permission.SystemName,+ Area = permission.Area,+ Category = permission.Category,+ Actions = permission.Actions+ };- //save new permission- await _permissionService.InsertPermission(permission1);+ //save new permission+ await _permissionService.InsertPermission(permission1);- //save localization- await permission1.SaveTranslationPermissionName(_translationService, _languageService);- }- return true;+ //save localization+ await permission1.SaveTranslationPermissionName(_translationService, _languageService);}++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallPermissionsCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallPermissionsCommandHandler.csindex 2acdea9d9..42fba7dc0 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallPermissionsCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallPermissionsCommandHandler.cs@@ -1,84 +1,82 @@-using Grand.Business.Core.Extensions;+using Grand.Business.Core.Commands.System.Security;+using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.Common.Localization;using Grand.Business.Core.Interfaces.Common.Security;-using Grand.Business.Core.Commands.System.Security;using Grand.Domain.Customers;using Grand.Domain.Permissions;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Security+namespace Grand.Business.System.Commands.Handlers.Security;++public class InstallPermissionsCommandHandler : IRequestHandler<InstallPermissionsCommand, bool>{- public class InstallPermissionsCommandHandler : IRequestHandler<InstallPermissionsCommand, bool>- {- private readonly IPermissionService _permissionService;- private readonly IGroupService _groupService;- private readonly ITranslationService _translationService;- private readonly ILanguageService _languageService;+ private readonly IGroupService _groupService;+ private readonly ILanguageService _languageService;+ private readonly IPermissionService _permissionService;+ private readonly ITranslationService _translationService;- public InstallPermissionsCommandHandler(- IPermissionService permissionService,- IGroupService groupService,- ITranslationService translationService,- ILanguageService languageService)- {- _permissionService = permissionService;- _groupService = groupService;- _translationService = translationService;- _languageService = languageService;- }+ public InstallPermissionsCommandHandler(+ IPermissionService permissionService,+ IGroupService groupService,+ ITranslationService translationService,+ ILanguageService languageService)+ {+ _permissionService = permissionService;+ _groupService = groupService;+ _translationService = translationService;+ _languageService = languageService;+ }- public async Task<bool> Handle(InstallPermissionsCommand request, CancellationToken cancellationToken)+ public async Task<bool> Handle(InstallPermissionsCommand request, CancellationToken cancellationToken)+ {+ //install new permissions+ var permissions = request.PermissionProvider.GetPermissions();+ foreach (var permission in permissions){- //install new permissions- var permissions = request.PermissionProvider.GetPermissions();- foreach (var permission in permissions)- {- var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);- if (permission1 != null) continue;- //new permission (install it)- permission1 = new Permission {- Name = permission.Name,- SystemName = permission.SystemName,- Area = permission.Area,- Category = permission.Category,- Actions = permission.Actions- };+ var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);+ if (permission1 != null) continue;+ //new permission (install it)+ permission1 = new Permission {+ Name = permission.Name,+ SystemName = permission.SystemName,+ Area = permission.Area,+ Category = permission.Category,+ Actions = permission.Actions+ };- //default customer group mappings- var defaultPermissions = request.PermissionProvider.GetDefaultPermissions();- foreach (var defaultPermission in defaultPermissions)+ //default customer group mappings+ var defaultPermissions = request.PermissionProvider.GetDefaultPermissions();+ foreach (var defaultPermission in defaultPermissions)+ {+ var customerGroup =+ await _groupService.GetCustomerGroupBySystemName(defaultPermission.CustomerGroupSystemName);+ if (customerGroup == null){- var customerGroup = await _groupService.GetCustomerGroupBySystemName(defaultPermission.CustomerGroupSystemName);- if (customerGroup == null)- {- //new role (save it)- customerGroup = new CustomerGroup {- Name = defaultPermission.CustomerGroupSystemName,- Active = true,- SystemName = defaultPermission.CustomerGroupSystemName- };- await _groupService.InsertCustomerGroup(customerGroup);- }--- var defaultMappingProvided = (from p in defaultPermission.Permissions- where p.SystemName == permission1.SystemName- select p).Any();- if (defaultMappingProvided)- {- permission1.CustomerGroups.Add(customerGroup.Id);- }+ //new role (save it)+ customerGroup = new CustomerGroup {+ Name = defaultPermission.CustomerGroupSystemName,+ Active = true,+ SystemName = defaultPermission.CustomerGroupSystemName+ };+ await _groupService.InsertCustomerGroup(customerGroup);}- //save new permission- await _permissionService.InsertPermission(permission1);- //save localization- await permission1.SaveTranslationPermissionName(_translationService, _languageService);+ var defaultMappingProvided = (from p in defaultPermission.Permissions+ where p.SystemName == permission1.SystemName+ select p).Any();+ if (defaultMappingProvided) permission1.CustomerGroups.Add(customerGroup.Id);}- return true;++ //save new permission+ await _permissionService.InsertPermission(permission1);++ //save localization+ await permission1.SaveTranslationPermissionName(_translationService, _languageService);}++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Commands/Handlers/Security/UninstallPermissionsCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Security/UninstallPermissionsCommandHandler.csindex 525b85e25..502237edc 100644--- a/src/Business/Grand.Business.System/Commands/Handlers/Security/UninstallPermissionsCommandHandler.cs+++ b/src/Business/Grand.Business.System/Commands/Handlers/Security/UninstallPermissionsCommandHandler.cs@@ -1,40 +1,40 @@-using Grand.Business.Core.Extensions;+using Grand.Business.Core.Commands.System.Security;+using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Common.Localization;using Grand.Business.Core.Interfaces.Common.Security;-using Grand.Business.Core.Commands.System.Security;using MediatR;-namespace Grand.Business.System.Commands.Handlers.Security+namespace Grand.Business.System.Commands.Handlers.Security;++public class UninstallPermissionsCommandHandler : IRequestHandler<UninstallPermissionsCommand, bool>{- public class UninstallPermissionsCommandHandler : IRequestHandler<UninstallPermissionsCommand, bool>- {- private readonly IPermissionService _permissionService;- private readonly ITranslationService _translationService;- private readonly ILanguageService _languageService;+ private readonly ILanguageService _languageService;+ private readonly IPermissionService _permissionService;+ private readonly ITranslationService _translationService;- public UninstallPermissionsCommandHandler(- IPermissionService permissionService,- ITranslationService translationService,- ILanguageService languageService)- {- _permissionService = permissionService;- _translationService = translationService;- _languageService = languageService;- }+ public UninstallPermissionsCommandHandler(+ IPermissionService permissionService,+ ITranslationService translationService,+ ILanguageService languageService)+ {+ _permissionService = permissionService;+ _translationService = translationService;+ _languageService = languageService;+ }- public async Task<bool> Handle(UninstallPermissionsCommand request, CancellationToken cancellationToken)+ public async Task<bool> Handle(UninstallPermissionsCommand request, CancellationToken cancellationToken)+ {+ var permissions = request.PermissionProvider.GetPermissions();+ foreach (var permission in permissions){- var permissions = request.PermissionProvider.GetPermissions();- foreach (var permission in permissions)- {- var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);- if (permission1 == null) continue;- await _permissionService.DeletePermission(permission1);+ var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);+ if (permission1 == null) continue;+ await _permissionService.DeletePermission(permission1);- //delete permission locales- await permission1.DeleteTranslationPermissionName(_translationService, _languageService);- }- return true;+ //delete permission locales+ await permission1.DeleteTranslationPermissionName(_translationService, _languageService);}++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Admin/AdminSiteMapService.cs b/src/Business/Grand.Business.System/Services/Admin/AdminSiteMapService.csindex eab288c9a..c093631d1 100644--- a/src/Business/Grand.Business.System/Services/Admin/AdminSiteMapService.cs+++ b/src/Business/Grand.Business.System/Services/Admin/AdminSiteMapService.cs@@ -1,79 +1,77 @@using Grand.Business.Core.Interfaces.System.Admin;-using Grand.Infrastructure.Caching;-using Grand.Domain.Admin;using Grand.Data;+using Grand.Domain.Admin;+using Grand.Infrastructure.Caching;using Grand.Infrastructure.Caching.Constants;using Grand.Infrastructure.Extensions;using MediatR;-namespace Grand.Business.System.Services.Admin+namespace Grand.Business.System.Services.Admin;++public class AdminSiteMapService : IAdminSiteMapService{- public class AdminSiteMapService : IAdminSiteMapService+ private readonly IRepository<AdminSiteMap> _adminSiteMapRepository;+ private readonly ICacheBase _cacheBase;+ private readonly IMediator _mediator;++ public AdminSiteMapService(+ IRepository<AdminSiteMap> adminSiteMapRepository,+ ICacheBase cacheBase,+ IMediator mediator){- private readonly IRepository<AdminSiteMap> _adminSiteMapRepository;- private readonly ICacheBase _cacheBase;- private readonly IMediator _mediator;-- public AdminSiteMapService(- IRepository<AdminSiteMap> adminSiteMapRepository,- ICacheBase cacheBase,- IMediator mediator)- {- _adminSiteMapRepository = adminSiteMapRepository;- _cacheBase = cacheBase;- _mediator = mediator;- }+ _adminSiteMapRepository = adminSiteMapRepository;+ _cacheBase = cacheBase;+ _mediator = mediator;+ }- public virtual async Task<IList<AdminSiteMap>> GetSiteMap()+ public virtual async Task<IList<AdminSiteMap>> GetSiteMap()+ {+ return await _cacheBase.GetAsync(CacheKey.ADMIN_SITEMAP_KEY, () =>{- return await _cacheBase.GetAsync(CacheKey.ADMIN_SITEMAP_KEY, () =>- {- var query = from c in _adminSiteMapRepository.Table- orderby c.DisplayOrder- select c;+ var query = from c in _adminSiteMapRepository.Table+ orderby c.DisplayOrder+ select c;- return Task.FromResult(query.ToList());- });- }+ return Task.FromResult(query.ToList());+ });+ }- public virtual async Task InsertSiteMap(AdminSiteMap entity)- {- ArgumentNullException.ThrowIfNull(entity);+ public virtual async Task InsertSiteMap(AdminSiteMap entity)+ {+ ArgumentNullException.ThrowIfNull(entity);- await _adminSiteMapRepository.InsertAsync(entity);+ await _adminSiteMapRepository.InsertAsync(entity);- //clear cache- await _cacheBase.RemoveByPrefix(CacheKey.ADMIN_SITEMAP_PATTERN_KEY);-- //event notification- await _mediator.EntityInserted(entity);+ //clear cache+ await _cacheBase.RemoveByPrefix(CacheKey.ADMIN_SITEMAP_PATTERN_KEY);- }+ //event notification+ await _mediator.EntityInserted(entity);+ }- public virtual async Task UpdateSiteMap(AdminSiteMap entity)- {- ArgumentNullException.ThrowIfNull(entity);+ public virtual async Task UpdateSiteMap(AdminSiteMap entity)+ {+ ArgumentNullException.ThrowIfNull(entity);- await _adminSiteMapRepository.UpdateAsync(entity);+ await _adminSiteMapRepository.UpdateAsync(entity);- //clear cache- await _cacheBase.RemoveByPrefix(CacheKey.ADMIN_SITEMAP_PATTERN_KEY);+ //clear cache+ await _cacheBase.RemoveByPrefix(CacheKey.ADMIN_SITEMAP_PATTERN_KEY);- //event notification- await _mediator.EntityUpdated(entity);- }+ //event notification+ await _mediator.EntityUpdated(entity);+ }- public virtual async Task DeleteSiteMap(AdminSiteMap entity)- {- ArgumentNullException.ThrowIfNull(entity);+ public virtual async Task DeleteSiteMap(AdminSiteMap entity)+ {+ ArgumentNullException.ThrowIfNull(entity);- await _adminSiteMapRepository.DeleteAsync(entity);+ await _adminSiteMapRepository.DeleteAsync(entity);- //clear cache- await _cacheBase.RemoveByPrefix(CacheKey.ADMIN_SITEMAP_PATTERN_KEY);+ //clear cache+ await _cacheBase.RemoveByPrefix(CacheKey.ADMIN_SITEMAP_PATTERN_KEY);- //event notification- await _mediator.EntityDeleted(entity);- }+ //event notification+ await _mediator.EntityDeleted(entity);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/CancelOrderScheduledTask.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/CancelOrderScheduledTask.csindex 360aac7fe..7cb53fc2b 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/CancelOrderScheduledTask.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/CancelOrderScheduledTask.cs@@ -2,33 +2,32 @@using Grand.Business.Core.Interfaces.System.ScheduleTasks;using Grand.Domain.Common;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++public class CancelOrderScheduledTask : IScheduleTask{- public class CancelOrderScheduledTask : IScheduleTask- {- private readonly SystemSettings _systemSettings;- private readonly IOrderService _orderService;+ private readonly IOrderService _orderService;+ private readonly SystemSettings _systemSettings;- public CancelOrderScheduledTask(- SystemSettings systemSettings,- IOrderService orderService)- {- _systemSettings = systemSettings;- _orderService = orderService;- }+ public CancelOrderScheduledTask(+ SystemSettings systemSettings,+ IOrderService orderService)+ {+ _systemSettings = systemSettings;+ _orderService = orderService;+ }- public async Task Execute()- {- if (!_systemSettings.DaysToCancelUnpaidOrder.HasValue)- return;+ public async Task Execute()+ {+ if (!_systemSettings.DaysToCancelUnpaidOrder.HasValue)+ return;- DateTime startCancelDate = CalculateStartCancelDate(_systemSettings.DaysToCancelUnpaidOrder.Value);- await _orderService.CancelExpiredOrders(startCancelDate);- }+ var startCancelDate = CalculateStartCancelDate(_systemSettings.DaysToCancelUnpaidOrder.Value);+ await _orderService.CancelExpiredOrders(startCancelDate);+ }- private DateTime CalculateStartCancelDate(int daysToCancelUnpaidOrder)- {- return DateTime.UtcNow.Date.AddDays(-daysToCancelUnpaidOrder);- }+ private DateTime CalculateStartCancelDate(int daysToCancelUnpaidOrder)+ {+ return DateTime.UtcNow.Date.AddDays(-daysToCancelUnpaidOrder);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ClearCacheScheduleTask.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ClearCacheScheduleTask.csindex 85f928865..9968458e4 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ClearCacheScheduleTask.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ClearCacheScheduleTask.cs@@ -1,26 +1,25 @@using Grand.Business.Core.Interfaces.System.ScheduleTasks;using Grand.Infrastructure.Caching;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++/// <summary>+/// Clear cache scheduled task implementation+/// </summary>+public class ClearCacheScheduleTask : IScheduleTask{+ private readonly ICacheBase _cacheBase;++ public ClearCacheScheduleTask(ICacheBase cacheBase)+ {+ _cacheBase = cacheBase;+ }+/// <summary>- /// Clear cache scheduled task implementation+ /// Executes a task/// </summary>- public class ClearCacheScheduleTask : IScheduleTask+ public async Task Execute(){- private readonly ICacheBase _cacheBase;-- public ClearCacheScheduleTask(ICacheBase cacheBase)- {- _cacheBase = cacheBase;- }-- /// <summary>- /// Executes a task- /// </summary>- public async Task Execute()- {- await _cacheBase.Clear();- }+ await _cacheBase.Clear();}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/DeleteGuestsScheduleTask.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/DeleteGuestsScheduleTask.csindex ebe8fc3ad..a9919c7b8 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/DeleteGuestsScheduleTask.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/DeleteGuestsScheduleTask.cs@@ -2,31 +2,30 @@using Grand.Business.Core.Interfaces.System.ScheduleTasks;using Grand.Domain.Common;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++/// <summary>+/// Represents a task for deleting guest customers+/// </summary>+public class DeleteGuestsScheduleTask : IScheduleTask{+ private readonly ICustomerService _customerService;+ private readonly SystemSettings _systemSettings;++ public DeleteGuestsScheduleTask(ICustomerService customerService, SystemSettings systemSettings)+ {+ _customerService = customerService;+ _systemSettings = systemSettings;+ }+/// <summary>- /// Represents a task for deleting guest customers+ /// Executes a task/// </summary>- public class DeleteGuestsScheduleTask : IScheduleTask+ public async Task Execute(){- private readonly ICustomerService _customerService;- private readonly SystemSettings _systemSettings;-- public DeleteGuestsScheduleTask(ICustomerService customerService, SystemSettings systemSettings)- {- _customerService = customerService;- _systemSettings = systemSettings;- }-- /// <summary>- /// Executes a task- /// </summary>- public async Task Execute()- {- var olderThanMinutes = _systemSettings.DeleteGuestTaskOlderThanMinutes;- // Default value in case 0 is returned. 0 would effectively disable this service and harm performance.- olderThanMinutes = olderThanMinutes == 0 ? 1440 : olderThanMinutes;- await _customerService.DeleteGuestCustomers(null, DateTime.UtcNow.AddMinutes(-olderThanMinutes), true);- }+ var olderThanMinutes = _systemSettings.DeleteGuestTaskOlderThanMinutes;+ // Default value in case 0 is returned. 0 would effectively disable this service and harm performance.+ olderThanMinutes = olderThanMinutes == 0 ? 1440 : olderThanMinutes;+ await _customerService.DeleteGuestCustomers(null, DateTime.UtcNow.AddMinutes(-olderThanMinutes), true);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/EndAuctionsTask.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/EndAuctionsTask.csindex 7e7979754..b94f340aa 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/EndAuctionsTask.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/EndAuctionsTask.cs@@ -5,67 +5,72 @@ using Grand.Business.Core.Interfaces.Messages;using Grand.Business.Core.Interfaces.System.ScheduleTasks;using Grand.Business.Core.Utilities.Checkout;using Grand.Domain.Localization;+using Grand.Domain.Orders;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++/// <summary>+/// Represents a task end auctions+/// </summary>+public class EndAuctionsTask : IScheduleTask{+ private readonly IAuctionService _auctionService;+ private readonly ICustomerService _customerService;+ private readonly LanguageSettings _languageSettings;+ private readonly ILogger<EndAuctionsTask> _logger;+ private readonly IMessageProviderService _messageProviderService;+ private readonly IShoppingCartService _shoppingCartService;++ public EndAuctionsTask(IAuctionService auctionService,+ IMessageProviderService messageProviderService, LanguageSettings translationService,+ IShoppingCartService shoppingCartService,+ ICustomerService customerService, ILogger<EndAuctionsTask> logger)+ {+ _auctionService = auctionService;+ _messageProviderService = messageProviderService;+ _languageSettings = translationService;+ _shoppingCartService = shoppingCartService;+ _customerService = customerService;+ _logger = logger;+ }+/// <summary>- /// Represents a task end auctions+ /// Executes a task/// </summary>- public class EndAuctionsTask : IScheduleTask+ public async Task Execute(){- private readonly IAuctionService _auctionService;- private readonly IMessageProviderService _messageProviderService;- private readonly LanguageSettings _languageSettings;- private readonly IShoppingCartService _shoppingCartService;- private readonly ICustomerService _customerService;- private readonly ILogger<EndAuctionsTask> _logger;-- public EndAuctionsTask(IAuctionService auctionService,- IMessageProviderService messageProviderService, LanguageSettings translationService, IShoppingCartService shoppingCartService,- ICustomerService customerService, ILogger<EndAuctionsTask> logger)+ var auctionsToEnd = await _auctionService.GetAuctionsToEnd();+ foreach (var auctionToEnd in auctionsToEnd){- _auctionService = auctionService;- _messageProviderService = messageProviderService;- _languageSettings = translationService;- _shoppingCartService = shoppingCartService;- _customerService = customerService;- _logger = logger;- }-- /// <summary>- /// Executes a task- /// </summary>- public async Task Execute()- {- var auctionsToEnd = await _auctionService.GetAuctionsToEnd();- foreach (var auctionToEnd in auctionsToEnd)+ var bid = (await _auctionService.GetBidsByProductId(auctionToEnd.Id)).MaxBy(x => x.Amount);+ if (bid == null){- var bid = (await _auctionService.GetBidsByProductId(auctionToEnd.Id)).MaxBy(x => x.Amount);- if (bid == null)- {- await _auctionService.UpdateAuctionEnded(auctionToEnd, true);- await _messageProviderService.SendAuctionEndedStoreOwnerMessage(auctionToEnd, _languageSettings.DefaultAdminLanguageId, null);- continue;- }+ await _auctionService.UpdateAuctionEnded(auctionToEnd, true);+ await _messageProviderService.SendAuctionEndedStoreOwnerMessage(auctionToEnd,+ _languageSettings.DefaultAdminLanguageId, null);+ continue;+ }- var warnings = (await _shoppingCartService.AddToCart(await _customerService.GetCustomerById(bid.CustomerId), bid.ProductId, Domain.Orders.ShoppingCartType.Auctions,- bid.StoreId, bid.WarehouseId, customerEnteredPrice: bid.Amount,- validator: new ShoppingCartValidatorOptions { GetRequiredProductWarnings = false })).warnings;+ var warnings = (await _shoppingCartService.AddToCart(await _customerService.GetCustomerById(bid.CustomerId),+ bid.ProductId, ShoppingCartType.Auctions,+ bid.StoreId, bid.WarehouseId, customerEnteredPrice: bid.Amount,+ validator: new ShoppingCartValidatorOptions { GetRequiredProductWarnings = false })).warnings;- if (!warnings.Any())- {- bid.Win = true;- await _auctionService.UpdateBid(bid);- await _messageProviderService.SendAuctionEndedStoreOwnerMessage(auctionToEnd, _languageSettings.DefaultAdminLanguageId, bid);- await _messageProviderService.SendAuctionWinEndedCustomerMessage(auctionToEnd, null, bid);- await _messageProviderService.SendAuctionEndedLostCustomerMessage(auctionToEnd, null, bid);- await _auctionService.UpdateAuctionEnded(auctionToEnd, true);- }- else- {- _logger.LogInformation("EndAuctionTask - Product {Name} - warnings {Join}", auctionToEnd.Name, string.Join(",", warnings.ToArray()));- }+ if (!warnings.Any())+ {+ bid.Win = true;+ await _auctionService.UpdateBid(bid);+ await _messageProviderService.SendAuctionEndedStoreOwnerMessage(auctionToEnd,+ _languageSettings.DefaultAdminLanguageId, bid);+ await _messageProviderService.SendAuctionWinEndedCustomerMessage(auctionToEnd, null, bid);+ await _messageProviderService.SendAuctionEndedLostCustomerMessage(auctionToEnd, null, bid);+ await _auctionService.UpdateAuctionEnded(auctionToEnd, true);+ }+ else+ {+ _logger.LogInformation("EndAuctionTask - Product {Name} - warnings {Join}", auctionToEnd.Name,+ string.Join(",", warnings.ToArray()));}}}diff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/GenerateSitemapXmlTask.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/GenerateSitemapXmlTask.csindex d7ab00bb6..13d082884 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/GenerateSitemapXmlTask.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/GenerateSitemapXmlTask.cs@@ -1,61 +1,60 @@-using Grand.Business.Core.Interfaces.Common.Localization;+using Grand.Business.Core.Commands.System.Common;+using Grand.Business.Core.Interfaces.Common.Localization;using Grand.Business.Core.Interfaces.Common.Stores;using Grand.Business.Core.Interfaces.Storage;-using Grand.Business.Core.Commands.System.Common;using Grand.Business.Core.Interfaces.System.ScheduleTasks;using MediatR;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++/// <summary>+/// Represents a task end auctions+/// </summary>+public class GenerateSitemapXmlTask : IScheduleTask{+ private readonly ILanguageService _languageService;+ private readonly IMediaFileStore _mediaFileStore;+ private readonly IMediator _mediator;+ private readonly IStoreService _storeService;++ public GenerateSitemapXmlTask(IMediator mediator,+ ILanguageService languageService,+ IStoreService storeService,+ IMediaFileStore mediaFileStore)+ {+ _mediator = mediator;+ _languageService = languageService;+ _storeService = storeService;+ _mediaFileStore = mediaFileStore;+ }+/// <summary>- /// Represents a task end auctions+ /// Executes a task/// </summary>- public class GenerateSitemapXmlTask : IScheduleTask+ public async Task Execute(){- private readonly IMediator _mediator;- private readonly ILanguageService _languageService;- private readonly IStoreService _storeService;- private readonly IMediaFileStore _mediaFileStore;-- public GenerateSitemapXmlTask(IMediator mediator,- ILanguageService languageService,- IStoreService storeService,- IMediaFileStore mediaFileStore)- {- _mediator = mediator;- _languageService = languageService;- _storeService = storeService;- _mediaFileStore = mediaFileStore;- }+ var stores = await _storeService.GetAllStores();+ var languages = await _languageService.GetAllLanguages();++ var file = "sitemap.xml";- /// <summary>- /// Executes a task- /// </summary>- public async Task Execute()+ foreach (var store in stores){- var stores = await _storeService.GetAllStores();- var languages = await _languageService.GetAllLanguages();+ var storeLanguages = await _languageService.GetAllLanguages(storeId: store.Id);+ foreach (var lang in storeLanguages)+ {+ var siteMap = await _mediator.Send(new GetSitemapXmlCommand {+ Language = lang,+ Store = store+ });- var file = "sitemap.xml";+ if (!(stores.Count == 1 && languages.Count == 1))+ file = $"sitemap-{store.Shortcut}-{lang.UniqueSeoCode}.xml";- foreach (var store in stores)- {- var storeLanguages = await _languageService.GetAllLanguages(storeId: store.Id);- foreach (var lang in storeLanguages)- {- var siteMap = await _mediator.Send(new GetSitemapXmlCommand {- Language = lang,- Store = store- });-- if (!(stores.Count == 1 && languages.Count == 1))- file = $"sitemap-{store.Shortcut}-{lang.UniqueSeoCode}.xml";-- if (stores.Count == 1 && languages.Count > 1)- file = $"sitemap-{lang.UniqueSeoCode}.xml";-- await _mediaFileStore.WriteAllText(file, siteMap);- }+ if (stores.Count == 1 && languages.Count > 1)+ file = $"sitemap-{lang.UniqueSeoCode}.xml";++ await _mediaFileStore.WriteAllText(file, siteMap);}}}diff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/QueuedMessagesSendScheduleTask.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/QueuedMessagesSendScheduleTask.csindex a3251b525..f51c516f9 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/QueuedMessagesSendScheduleTask.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/QueuedMessagesSendScheduleTask.cs@@ -2,74 +2,75 @@using Grand.Business.Core.Interfaces.System.ScheduleTasks;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++/// <summary>+/// Represents a task for sending queued message+/// </summary>+public class QueuedMessagesSendScheduleTask : IScheduleTask{+ private readonly IEmailAccountService _emailAccountService;+ private readonly IEmailSender _emailSender;+ private readonly ILogger<QueuedMessagesSendScheduleTask> _logger;+ private readonly IQueuedEmailService _queuedEmailService;+++ public QueuedMessagesSendScheduleTask(IQueuedEmailService queuedEmailService,+ IEmailSender emailSender, ILogger<QueuedMessagesSendScheduleTask> logger,+ IEmailAccountService emailAccountService)+ {+ _queuedEmailService = queuedEmailService;+ _emailSender = emailSender;+ _logger = logger;+ _emailAccountService = emailAccountService;+ }+/// <summary>- /// Represents a task for sending queued message+ /// Executes a task/// </summary>- public class QueuedMessagesSendScheduleTask : IScheduleTask+ public async Task Execute(){- private readonly IQueuedEmailService _queuedEmailService;- private readonly IEmailSender _emailSender;- private readonly ILogger<QueuedMessagesSendScheduleTask> _logger;- private readonly IEmailAccountService _emailAccountService;--- public QueuedMessagesSendScheduleTask(IQueuedEmailService queuedEmailService,- IEmailSender emailSender, ILogger<QueuedMessagesSendScheduleTask> logger, IEmailAccountService emailAccountService)+ const int maxTries = 3;+ var queuedEmails = await _queuedEmailService.SearchEmails(null, null, null, null, null, true, true, maxTries,+ false, -1, null, 0, 500);+ foreach (var queuedEmail in queuedEmails){- _queuedEmailService = queuedEmailService;- _emailSender = emailSender;- _logger = logger;- _emailAccountService = emailAccountService;- }+ var bcc = string.IsNullOrWhiteSpace(queuedEmail.Bcc)+ ? null+ : queuedEmail.Bcc.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);+ var cc = string.IsNullOrWhiteSpace(queuedEmail.CC)+ ? null+ : queuedEmail.CC.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);- /// <summary>- /// Executes a task- /// </summary>- public async Task Execute()- {- const int maxTries = 3;- var queuedEmails = await _queuedEmailService.SearchEmails(null, null, null, null, null, true, true, maxTries, false, -1, null, 0, 500);- foreach (var queuedEmail in queuedEmails)+ try{- var bcc = string.IsNullOrWhiteSpace(queuedEmail.Bcc)- ? null- : queuedEmail.Bcc.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);- var cc = string.IsNullOrWhiteSpace(queuedEmail.CC)- ? null- : queuedEmail.CC.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);+ var emailAccount = await _emailAccountService.GetEmailAccountById(queuedEmail.EmailAccountId);+ await _emailSender.SendEmail(emailAccount,+ queuedEmail.Subject,+ queuedEmail.Body,+ queuedEmail.From,+ queuedEmail.FromName,+ queuedEmail.To,+ queuedEmail.ToName,+ queuedEmail.ReplyTo,+ queuedEmail.ReplyToName,+ bcc,+ cc,+ queuedEmail.AttachmentFilePath,+ queuedEmail.AttachmentFileName,+ queuedEmail.AttachedDownloads);- try- {- var emailAccount = await _emailAccountService.GetEmailAccountById(queuedEmail.EmailAccountId);- await _emailSender.SendEmail(emailAccount,- queuedEmail.Subject,- queuedEmail.Body,- queuedEmail.From,- queuedEmail.FromName,- queuedEmail.To,- queuedEmail.ToName,- queuedEmail.ReplyTo,- queuedEmail.ReplyToName,- bcc,- cc,- queuedEmail.AttachmentFilePath,- queuedEmail.AttachmentFileName,- queuedEmail.AttachedDownloads);-- queuedEmail.SentOnUtc = DateTime.UtcNow;- }- catch (Exception exc)- {- _logger.LogError(exc, "Error sending e-mail. {ExcMessage}", exc.Message);- }- finally- {- queuedEmail.SentTries = queuedEmail.SentTries + 1;- await _queuedEmailService.UpdateQueuedEmail(queuedEmail);- }+ queuedEmail.SentOnUtc = DateTime.UtcNow;+ }+ catch (Exception exc)+ {+ _logger.LogError(exc, "Error sending e-mail. {ExcMessage}", exc.Message);+ }+ finally+ {+ queuedEmail.SentTries = queuedEmail.SentTries + 1;+ await _queuedEmailService.UpdateQueuedEmail(queuedEmail);}}}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ScheduleTaskService.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ScheduleTaskService.csindex 0f646be4e..04911715e 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ScheduleTaskService.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/ScheduleTaskService.cs@@ -2,93 +2,91 @@ using Grand.Business.Core.Interfaces.System.ScheduleTasks;using Grand.Data;using Grand.Domain.Tasks;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++/// <summary>+/// Task service+/// </summary>+public class ScheduleTaskService : IScheduleTaskService{+ #region Fields++ private readonly IRepository<ScheduleTask> _taskRepository;++ #endregion++ #region Ctor++ public ScheduleTaskService(IRepository<ScheduleTask> taskRepository)+ {+ _taskRepository = taskRepository;+ }++ #endregion+/// <summary>- /// Task service+ /// Gets a task/// </summary>- public class ScheduleTaskService : IScheduleTaskService+ /// <param name="taskId">Task identifier</param>+ /// <returns>Task</returns>+ public virtual Task<ScheduleTask> GetTaskById(string taskId){- #region Fields-- private readonly IRepository<ScheduleTask> _taskRepository;-- #endregion-- #region Ctor-- public ScheduleTaskService(IRepository<ScheduleTask> taskRepository)- {- _taskRepository = taskRepository;- }-- #endregion-- /// <summary>- /// Gets a task- /// </summary>- /// <param name="taskId">Task identifier</param>- /// <returns>Task</returns>- public virtual Task<ScheduleTask> GetTaskById(string taskId)- {- return _taskRepository.GetByIdAsync(taskId);- }-- /// <summary>- /// Gets a task by its type- /// </summary>- /// <param name="type">Task type</param>- /// <returns>Task</returns>- public virtual async Task<ScheduleTask> GetTaskByType(string type)- {- if (string.IsNullOrWhiteSpace(type))- return null;-- var query = _taskRepository.Table.Where(st => st.Type == type).OrderByDescending(t => t.Id);- return await Task.FromResult(query.FirstOrDefault());- }-- /// <summary>- /// Gets all tasks- /// </summary>- /// <returns>Tasks</returns>- public virtual async Task<IList<ScheduleTask>> GetAllTasks()- {- return await Task.FromResult(_taskRepository.Table.ToList());- }-- /// <summary>- /// Insert the task- /// </summary>- /// <param name="task">Task</param>- public virtual async Task<ScheduleTask> InsertTask(ScheduleTask task)- {- ArgumentNullException.ThrowIfNull(task);-- return await _taskRepository.InsertAsync(task);- }-- /// <summary>- /// Updates the task- /// </summary>- /// <param name="task">Task</param>- public virtual async Task UpdateTask(ScheduleTask task)- {- ArgumentNullException.ThrowIfNull(task);-- await _taskRepository.UpdateAsync(task);- }-- /// <summary>- /// Delete the task- /// </summary>- /// <param name="task">Task</param>- public virtual async Task DeleteTask(ScheduleTask task)- {- ArgumentNullException.ThrowIfNull(task);-- await _taskRepository.DeleteAsync(task);- }+ return _taskRepository.GetByIdAsync(taskId);}-}+ /// <summary>+ /// Gets a task by its type+ /// </summary>+ /// <param name="type">Task type</param>+ /// <returns>Task</returns>+ public virtual async Task<ScheduleTask> GetTaskByType(string type)+ {+ if (string.IsNullOrWhiteSpace(type))+ return null;++ var query = _taskRepository.Table.Where(st => st.Type == type).OrderByDescending(t => t.Id);+ return await Task.FromResult(query.FirstOrDefault());+ }++ /// <summary>+ /// Gets all tasks+ /// </summary>+ /// <returns>Tasks</returns>+ public virtual async Task<IList<ScheduleTask>> GetAllTasks()+ {+ return await Task.FromResult(_taskRepository.Table.ToList());+ }++ /// <summary>+ /// Insert the task+ /// </summary>+ /// <param name="task">Task</param>+ public virtual async Task<ScheduleTask> InsertTask(ScheduleTask task)+ {+ ArgumentNullException.ThrowIfNull(task);++ return await _taskRepository.InsertAsync(task);+ }++ /// <summary>+ /// Updates the task+ /// </summary>+ /// <param name="task">Task</param>+ public virtual async Task UpdateTask(ScheduleTask task)+ {+ ArgumentNullException.ThrowIfNull(task);++ await _taskRepository.UpdateAsync(task);+ }++ /// <summary>+ /// Delete the task+ /// </summary>+ /// <param name="task">Task</param>+ public virtual async Task DeleteTask(ScheduleTask task)+ {+ ArgumentNullException.ThrowIfNull(task);++ await _taskRepository.DeleteAsync(task);+ }+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/UpdateExchangeRateScheduleTask.cs b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/UpdateExchangeRateScheduleTask.csindex d8935b609..87982520a 100644--- a/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/UpdateExchangeRateScheduleTask.cs+++ b/src/Business/Grand.Business.System/Services/BackgroundServices/ScheduleTasks/UpdateExchangeRateScheduleTask.cs@@ -3,44 +3,44 @@ using Grand.Business.Core.Interfaces.System.ScheduleTasks;using Grand.Domain.Directory;using Grand.Domain.Tasks;-namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks+namespace Grand.Business.System.Services.BackgroundServices.ScheduleTasks;++/// <summary>+/// Represents a task for updating exchange rates+/// </summary>+public class UpdateExchangeRateScheduleTask : ScheduleTask, IScheduleTask{+ private readonly ICurrencyService _currencyService;+ private readonly CurrencySettings _currencySettings;+ private readonly IExchangeRateService _exchangeRateService;++ public UpdateExchangeRateScheduleTask(+ ICurrencyService currencyService,+ IExchangeRateService exchangeRateService,+ CurrencySettings currencySettings)+ {+ _currencyService = currencyService;+ _exchangeRateService = exchangeRateService;+ _currencySettings = currencySettings;+ }+/// <summary>- /// Represents a task for updating exchange rates+ /// Executes a task/// </summary>- public class UpdateExchangeRateScheduleTask : ScheduleTask, IScheduleTask+ public async Task Execute(){- private readonly ICurrencyService _currencyService;- private readonly IExchangeRateService _exchangeRateService;- private readonly CurrencySettings _currencySettings;- public UpdateExchangeRateScheduleTask(- ICurrencyService currencyService,- IExchangeRateService exchangeRateService,- CurrencySettings currencySettings)- {- _currencyService = currencyService;- _exchangeRateService = exchangeRateService;- _currencySettings = currencySettings;- }+ if (!_currencySettings.AutoUpdateEnabled)+ return;- /// <summary>- /// Executes a task- /// </summary>- public async Task Execute()- {- if (!_currencySettings.AutoUpdateEnabled)- return;+ var primaryCurrencyCode = (await _currencyService.GetPrimaryExchangeRateCurrency()).CurrencyCode;+ var exchangeRates = await _exchangeRateService.GetCurrencyLiveRates(primaryCurrencyCode);- var primaryCurrencyCode = (await _currencyService.GetPrimaryExchangeRateCurrency()).CurrencyCode;- var exchangeRates = await _exchangeRateService.GetCurrencyLiveRates(primaryCurrencyCode);-- foreach (var exchangeRate in exchangeRates)- {- var currency = await _currencyService.GetCurrencyByCode(exchangeRate.CurrencyCode);- if (currency == null) continue;- currency.Rate = exchangeRate.Rate;- await _currencyService.UpdateCurrency(currency);- }+ foreach (var exchangeRate in exchangeRates)+ {+ var currency = await _currencyService.GetCurrencyByCode(exchangeRate.CurrencyCode);+ if (currency == null) continue;+ currency.Rate = exchangeRate.Rate;+ await _currencyService.UpdateCurrency(currency);}}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataAffiliates.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataAffiliates.csindex 49800806f..a544f0067 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataAffiliates.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataAffiliates.cs@@ -1,32 +1,29 @@using Grand.Domain.Affiliates;using Grand.Domain.Common;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallAffiliates(){- protected virtual async Task InstallAffiliates()- {- var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");- var affiliateAddress = new Address- {- FirstName = "John",- LastName = "Smith",- Email = "[email protected]",- Company = "Company name here...",- City = "New York",- Address1 = "21 West 52nd Street",- ZipPostalCode = "10021",- PhoneNumber = "123456789",- StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,- CountryId = country?.Id,- };- var affilate = new Affiliate- {- Active = true,- Address = affiliateAddress- };- await _affiliateRepository.InsertAsync(affilate);- }+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");+ var affiliateAddress = new Address {+ FirstName = "John",+ LastName = "Smith",+ Email = "[email protected]",+ Company = "Company name here...",+ City = "New York",+ Address1 = "21 West 52nd Street",+ ZipPostalCode = "10021",+ PhoneNumber = "123456789",+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,+ CountryId = country?.Id+ };+ var affilate = new Affiliate {+ Active = true,+ Address = affiliateAddress+ };+ await _affiliateRepository.InsertAsync(affilate);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataBlogPosts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataBlogPosts.csindex 812a63b20..7384056d4 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataBlogPosts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataBlogPosts.cs@@ -2,50 +2,48 @@using Grand.Domain.Blogs;using Grand.Domain.Seo;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallBlogPosts(){- protected virtual async Task InstallBlogPosts()- {- var blogPosts = new List<BlogPost>- {- new BlogPost- {- AllowComments = false,- Title = "How GrandNode became the real open-source e-Commerce platform?",- BodyOverview = "<p>There are many e-commerce solutions on the market. Is everyone open-source? No, and even if they say yes, it may turn out to be a lie. GrandNode is a true open-source based on .NET Core and MongoDB. No hidden license fees, no additional licensing conditions. Pure open-source and GPL-3 license.</p>",- Body = "<p>There are many e-commerce solutions on the market. Is every open-source? No, and even if they say yes, it may turn out to be a lie. GrandNode is a true open-source platform based on .NET Core and MongoDB. No hidden license fees, no additional licensing conditions. Pure open-source and GPL-3 license.</p><p>An open-source platform shouldn't block your development. Forcing the leaving of information about the platform, paid licenses, obtaining paid license keys is an artificial invention that makes the platform paid and complicated.</p>",- Tags = "e-commerce, blog, moey"- },- new BlogPost- {- AllowComments = false,- Title = "Open-source e-commerce platform GrandNode",- BodyOverview = "<p>GrandNode is one of a kind open-source e-commerce platform. Thanks to most advanced ASP.NET Core framework and out of the box set of features it makes a perfect fit for multiple e-business models.</p>",- Body = "<p>Meet the flexible, the most versatile open-source e-commerce platform on the market. Use GrandNode and its ready-to-use integrations to sell everywhere with a single platform. GrandNode guarantees functionalities for now and for the future. We ensure both, the base needs of each e-commerce, and future features needed for expansion. GrandNode is one platform that suits various business models. It can successfully empower traditional B2C & B2B stores, helping local brands expand globally. Our solution supports booking processes, facilitates the management of the availability calendar and even enables the sale of online courses.</p>",- Tags = "e-commerce, grandnode, sample tag, money"- }- };-- blogPosts.ForEach(x=>_blogPostRepository.Insert(x));+ var blogPosts = new List<BlogPost> {+ new() {+ AllowComments = false,+ Title = "How GrandNode became the real open-source e-Commerce platform?",+ BodyOverview =+ "<p>There are many e-commerce solutions on the market. Is everyone open-source? No, and even if they say yes, it may turn out to be a lie. GrandNode is a true open-source based on .NET Core and MongoDB. No hidden license fees, no additional licensing conditions. Pure open-source and GPL-3 license.</p>",+ Body =+ "<p>There are many e-commerce solutions on the market. Is every open-source? No, and even if they say yes, it may turn out to be a lie. GrandNode is a true open-source platform based on .NET Core and MongoDB. No hidden license fees, no additional licensing conditions. Pure open-source and GPL-3 license.</p><p>An open-source platform shouldn't block your development. Forcing the leaving of information about the platform, paid licenses, obtaining paid license keys is an artificial invention that makes the platform paid and complicated.</p>",+ Tags = "e-commerce, blog, moey"+ },+ new() {+ AllowComments = false,+ Title = "Open-source e-commerce platform GrandNode",+ BodyOverview =+ "<p>GrandNode is one of a kind open-source e-commerce platform. Thanks to most advanced ASP.NET Core framework and out of the box set of features it makes a perfect fit for multiple e-business models.</p>",+ Body =+ "<p>Meet the flexible, the most versatile open-source e-commerce platform on the market. Use GrandNode and its ready-to-use integrations to sell everywhere with a single platform. GrandNode guarantees functionalities for now and for the future. We ensure both, the base needs of each e-commerce, and future features needed for expansion. GrandNode is one platform that suits various business models. It can successfully empower traditional B2C & B2B stores, helping local brands expand globally. Our solution supports booking processes, facilitates the management of the availability calendar and even enables the sale of online courses.</p>",+ Tags = "e-commerce, grandnode, sample tag, money"+ }+ };- //search engine names- foreach (var blogPost in blogPosts)- {- var seName = SeoExtensions.GenerateSlug(blogPost.Title, false, false, false);- await _entityUrlRepository.InsertAsync(new EntityUrl- {- EntityId = blogPost.Id,- EntityName = "BlogPost",- LanguageId = "",- IsActive = true,- Slug = seName- });- blogPost.SeName = seName;- await _blogPostRepository.UpdateAsync(blogPost);+ blogPosts.ForEach(x => _blogPostRepository.Insert(x));- }+ //search engine names+ foreach (var blogPost in blogPosts)+ {+ var seName = SeoExtensions.GenerateSlug(blogPost.Title, false, false, false);+ await _entityUrlRepository.InsertAsync(new EntityUrl {+ EntityId = blogPost.Id,+ EntityName = "BlogPost",+ LanguageId = "",+ IsActive = true,+ Slug = seName+ });+ blogPost.SeName = seName;+ await _blogPostRepository.UpdateAsync(blogPost);}}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataBrandLayouts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataBrandLayouts.csindex b45fb9898..bc1a860fc 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataBrandLayouts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataBrandLayouts.cs@@ -1,22 +1,19 @@using Grand.Domain.Catalog;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallBrandLayouts(){- protected virtual Task InstallBrandLayouts()- {- var brandLayouts = new List<BrandLayout>- {- new BrandLayout- {- Name = "Grid or Lines",- ViewPath = "BrandLayout.GridOrLines",- DisplayOrder = 1- }- };- brandLayouts.ForEach(x=>_brandLayoutRepository.Insert(x));- return Task.CompletedTask;- }+ var brandLayouts = new List<BrandLayout> {+ new() {+ Name = "Grid or Lines",+ ViewPath = "BrandLayout.GridOrLines",+ DisplayOrder = 1+ }+ };+ brandLayouts.ForEach(x => _brandLayoutRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataBrands.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataBrands.csindex 3d124f8e4..80d159f89 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataBrands.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataBrands.cs@@ -1,79 +1,85 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Catalog;+using Grand.Domain.Common;using Grand.Domain.Seo;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallBrands(){- protected virtual async Task InstallBrands()- {- var pictureService = _serviceProvider.GetRequiredService<IPictureService>();- var sampleImagesPath = GetSamplesPath();+ var pictureService = _serviceProvider.GetRequiredService<IPictureService>();+ var sampleImagesPath = GetSamplesPath();- var brandLayoutInGridAndLines =- _brandLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Grid or Lines");- if (brandLayoutInGridAndLines == null)- throw new Exception("Brand layout cannot be loaded");+ var brandLayoutInGridAndLines =+ _brandLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Grid or Lines");+ if (brandLayoutInGridAndLines == null)+ throw new Exception("Brand layout cannot be loaded");- var allbrands = new List<Brand>();- var brandXiaomi = new Brand {- Name = "Xiaomi",- BrandLayoutId = brandLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- Published = true,- DisplayOrder = 1- };- brandXiaomi.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "brand_xiaomi.jpg"), "image/pjpeg", pictureService.GetPictureSeName("Xiaomi"), "", "", false, Domain.Common.Reference.Brand, brandXiaomi.Id)).Id;- await _brandRepository.InsertAsync(brandXiaomi);- allbrands.Add(brandXiaomi);+ var allbrands = new List<Brand>();+ var brandXiaomi = new Brand {+ Name = "Xiaomi",+ BrandLayoutId = brandLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ Published = true,+ DisplayOrder = 1+ };+ brandXiaomi.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "brand_xiaomi.jpg"), "image/pjpeg",+ pictureService.GetPictureSeName("Xiaomi"), "", "", false, Reference.Brand, brandXiaomi.Id)).Id;+ await _brandRepository.InsertAsync(brandXiaomi);+ allbrands.Add(brandXiaomi);- var brandDell = new Brand {- Name = "Dell",- BrandLayoutId = brandLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- Published = true,- DisplayOrder = 5- };- brandDell.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "brand_dell.jpg"), "image/pjpeg", pictureService.GetPictureSeName("Dell"), "", "", false, Domain.Common.Reference.Brand, brandDell.Id)).Id;+ var brandDell = new Brand {+ Name = "Dell",+ BrandLayoutId = brandLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ Published = true,+ DisplayOrder = 5+ };+ brandDell.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "brand_dell.jpg"), "image/pjpeg",+ pictureService.GetPictureSeName("Dell"), "", "", false, Reference.Brand, brandDell.Id)).Id;- await _brandRepository.InsertAsync(brandDell);- allbrands.Add(brandDell);+ await _brandRepository.InsertAsync(brandDell);+ allbrands.Add(brandDell);- var brandAdidas = new Brand {- Name = "Adidas",- BrandLayoutId = brandLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- Published = true,- DisplayOrder = 5- };- brandAdidas.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "brand_adidas.jpg"), "image/pjpeg", pictureService.GetPictureSeName("Adidas"), "", "", false, Domain.Common.Reference.Brand, brandAdidas.Id)).Id;- await _brandRepository.InsertAsync(brandAdidas);- allbrands.Add(brandAdidas);+ var brandAdidas = new Brand {+ Name = "Adidas",+ BrandLayoutId = brandLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ Published = true,+ DisplayOrder = 5+ };+ brandAdidas.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "brand_adidas.jpg"), "image/pjpeg",+ pictureService.GetPictureSeName("Adidas"), "", "", false, Reference.Brand, brandAdidas.Id)).Id;+ await _brandRepository.InsertAsync(brandAdidas);+ allbrands.Add(brandAdidas);- //search engine names- foreach (var brand in allbrands)- {- brand.SeName = SeoExtensions.GenerateSlug(brand.Name, false, false, true);- await _entityUrlRepository.InsertAsync(new EntityUrl {- EntityId = brand.Id,- EntityName = "Brand",- LanguageId = "",- IsActive = true,- Slug = brand.SeName- });- await _brandRepository.UpdateAsync(brand);- }+ //search engine names+ foreach (var brand in allbrands)+ {+ brand.SeName = SeoExtensions.GenerateSlug(brand.Name, false, false, true);+ await _entityUrlRepository.InsertAsync(new EntityUrl {+ EntityId = brand.Id,+ EntityName = "Brand",+ LanguageId = "",+ IsActive = true,+ Slug = brand.SeName+ });+ await _brandRepository.UpdateAsync(brand);}}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCategories.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataCategories.csindex 8d785750b..7437515f7 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataCategories.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataCategories.cs@@ -1,282 +1,311 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Catalog;+using Grand.Domain.Common;using Grand.Domain.Seo;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallCategories(){- protected virtual async Task InstallCategories()- {- var pictureService = _serviceProvider.GetRequiredService<IPictureService>();+ var pictureService = _serviceProvider.GetRequiredService<IPictureService>();- //sample pictures- var sampleImagesPath = GetSamplesPath();+ //sample pictures+ var sampleImagesPath = GetSamplesPath();- var categoryLayoutInGridAndLines = _categoryLayoutRepository- .Table.FirstOrDefault(pt => pt.Name == "Grid or Lines");- if (categoryLayoutInGridAndLines == null)- throw new Exception("Category layout cannot be loaded");+ var categoryLayoutInGridAndLines = _categoryLayoutRepository+ .Table.FirstOrDefault(pt => pt.Name == "Grid or Lines");+ if (categoryLayoutInGridAndLines == null)+ throw new Exception("Category layout cannot be loaded");- //categories- var allCategories = new List<Category>();- var categoryComputers = new Category- {- Name = "Computers",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = "",- IncludeInMenu = true,- Published = true,- Flag = "New",- FlagStyle = "badge-danger",- DisplayOrder = 100- };- categoryComputers.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_computers.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Computers"), reference: Domain.Common.Reference.Category, objectId: categoryComputers.Id)).Id;- allCategories.Add(categoryComputers);+ //categories+ var allCategories = new List<Category>();+ var categoryComputers = new Category {+ Name = "Computers",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = "",+ IncludeInMenu = true,+ Published = true,+ Flag = "New",+ FlagStyle = "badge-danger",+ DisplayOrder = 100+ };+ categoryComputers.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_computers.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Computers"), reference: Reference.Category,+ objectId: categoryComputers.Id)).Id;+ allCategories.Add(categoryComputers);- var categoryTablets = new Category- {- Name = "Tablets",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categoryComputers.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categoryComputers.DisplayOrder + 1- };- categoryTablets.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_tablets.jpg"), "image/jpeg", pictureService.GetPictureSeName("Tablets"), reference: Domain.Common.Reference.Category, objectId: categoryTablets.Id)).Id;- allCategories.Add(categoryTablets);+ var categoryTablets = new Category {+ Name = "Tablets",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categoryComputers.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categoryComputers.DisplayOrder + 1+ };+ categoryTablets.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_tablets.jpg"), "image/jpeg",+ pictureService.GetPictureSeName("Tablets"), reference: Reference.Category,+ objectId: categoryTablets.Id))+ .Id;+ allCategories.Add(categoryTablets);- var categoryNotebooks = new Category- {- Name = "Notebooks",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categoryComputers.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categoryComputers.DisplayOrder + 2- };- categoryNotebooks.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_notebooks.jpg"), "image/jpeg", pictureService.GetPictureSeName("Notebooks"), reference: Domain.Common.Reference.Category, objectId: categoryNotebooks.Id)).Id;- allCategories.Add(categoryNotebooks);+ var categoryNotebooks = new Category {+ Name = "Notebooks",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categoryComputers.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categoryComputers.DisplayOrder + 2+ };+ categoryNotebooks.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_notebooks.jpg"), "image/jpeg",+ pictureService.GetPictureSeName("Notebooks"), reference: Reference.Category,+ objectId: categoryNotebooks.Id)).Id;+ allCategories.Add(categoryNotebooks);- var categorySmartwatches = new Category- {- Name = "Smartwatches",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categoryComputers.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categoryComputers.DisplayOrder + 3- };- categorySmartwatches.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_smartwatches.jpg"), "image/jpeg", pictureService.GetPictureSeName("Smartwatches"), reference: Domain.Common.Reference.Category, objectId: categorySmartwatches.Id)).Id;- allCategories.Add(categorySmartwatches);+ var categorySmartwatches = new Category {+ Name = "Smartwatches",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categoryComputers.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categoryComputers.DisplayOrder + 3+ };+ categorySmartwatches.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_smartwatches.jpg"), "image/jpeg",+ pictureService.GetPictureSeName("Smartwatches"), reference: Reference.Category,+ objectId: categorySmartwatches.Id)).Id;+ allCategories.Add(categorySmartwatches);- var categoryElectronics = new Category- {- Name = "Electronics",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- ParentCategoryId = "",- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- IncludeInMenu = true,- Published = true,- ShowOnHomePage = false,- DisplayOrder = 200- };- categoryElectronics.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_electronics.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Electronics"), reference: Domain.Common.Reference.Category, objectId: categoryElectronics.Id)).Id;- allCategories.Add(categoryElectronics);+ var categoryElectronics = new Category {+ Name = "Electronics",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ ParentCategoryId = "",+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ IncludeInMenu = true,+ Published = true,+ ShowOnHomePage = false,+ DisplayOrder = 200+ };+ categoryElectronics.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_electronics.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Electronics"), reference: Reference.Category,+ objectId: categoryElectronics.Id)).Id;+ allCategories.Add(categoryElectronics);- var categoryDisplay = new Category- {- Name = "Display",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categoryElectronics.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categoryElectronics.DisplayOrder + 1- };- categoryDisplay.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_display.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Display"), reference: Domain.Common.Reference.Category, objectId: categoryDisplay.Id)).Id;- allCategories.Add(categoryDisplay);+ var categoryDisplay = new Category {+ Name = "Display",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categoryElectronics.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categoryElectronics.DisplayOrder + 1+ };+ categoryDisplay.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_display.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Display"), reference: Reference.Category,+ objectId: categoryDisplay.Id))+ .Id;+ allCategories.Add(categoryDisplay);- var categorySmartphones = new Category- {- Name = "Smartphones",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categoryElectronics.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categoryElectronics.DisplayOrder + 2- };- categorySmartphones.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_smartphones.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Smartphones"), reference: Domain.Common.Reference.Category, objectId: categorySmartphones.Id)).Id;- allCategories.Add(categorySmartphones);+ var categorySmartphones = new Category {+ Name = "Smartphones",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categoryElectronics.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categoryElectronics.DisplayOrder + 2+ };+ categorySmartphones.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_smartphones.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Smartphones"), reference: Reference.Category,+ objectId: categorySmartphones.Id)).Id;+ allCategories.Add(categorySmartphones);- var categoryOthers = new Category- {- Name = "Others",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- ShowOnHomePage = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categoryElectronics.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categoryElectronics.DisplayOrder + 3- };- categoryOthers.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_accessories.jpg"), "image/jpeg", pictureService.GetPictureSeName("SmAccessoriesartphones"), reference: Domain.Common.Reference.Category, objectId: categoryOthers.Id)).Id;+ var categoryOthers = new Category {+ Name = "Others",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ ShowOnHomePage = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categoryElectronics.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categoryElectronics.DisplayOrder + 3+ };+ categoryOthers.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_accessories.jpg"), "image/jpeg",+ pictureService.GetPictureSeName("SmAccessoriesartphones"), reference: Reference.Category,+ objectId: categoryOthers.Id)).Id;- allCategories.Add(categoryOthers);+ allCategories.Add(categoryOthers);- var categorySport = new Category- {- Name = "Sport",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 9,- ParentCategoryId = "",- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9, 12",- IncludeInMenu = true,- Published = true,- ShowOnHomePage = true,- DisplayOrder = 300- };- categorySport.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_sport.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Sport"), reference: Domain.Common.Reference.Category, objectId: categorySport.Id)).Id;- allCategories.Add(categorySport);+ var categorySport = new Category {+ Name = "Sport",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 9,+ ParentCategoryId = "",+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9, 12",+ IncludeInMenu = true,+ Published = true,+ ShowOnHomePage = true,+ DisplayOrder = 300+ };+ categorySport.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_sport.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Sport"), reference: Reference.Category, objectId: categorySport.Id)).Id;+ allCategories.Add(categorySport);- var categoryShoes = new Category- {- Name = "Shoes",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categorySport.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categorySport.DisplayOrder + 1- };- categoryShoes.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_shoes.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Shoes"), reference: Domain.Common.Reference.Category, objectId: categoryShoes.Id)).Id;- allCategories.Add(categoryShoes);+ var categoryShoes = new Category {+ Name = "Shoes",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categorySport.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categorySport.DisplayOrder + 1+ };+ categoryShoes.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_shoes.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Shoes"), reference: Reference.Category, objectId: categoryShoes.Id)).Id;+ allCategories.Add(categoryShoes);- var categoryApparel = new Category- {- Name = "Apparel",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- ParentCategoryId = categorySport.Id,- IncludeInMenu = true,- Published = true,- DisplayOrder = categorySport.DisplayOrder + 2- };- categoryApparel.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_sport.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Apparel"), reference: Domain.Common.Reference.Category, objectId: categoryApparel.Id)).Id;+ var categoryApparel = new Category {+ Name = "Apparel",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ ParentCategoryId = categorySport.Id,+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categorySport.DisplayOrder + 2+ };+ categoryApparel.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_sport.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Apparel"), reference: Reference.Category,+ objectId: categoryApparel.Id))+ .Id;- allCategories.Add(categoryApparel);+ allCategories.Add(categoryApparel);- var categoryBalls = new Category- {- Name = "Balls",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- ParentCategoryId = categorySport.Id,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- IncludeInMenu = true,- Published = true,- DisplayOrder = categorySport.DisplayOrder + 3- };- categoryBalls.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_balls.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Balls"), reference: Domain.Common.Reference.Category, objectId: categoryBalls.Id)).Id;- allCategories.Add(categoryBalls);+ var categoryBalls = new Category {+ Name = "Balls",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ ParentCategoryId = categorySport.Id,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = categorySport.DisplayOrder + 3+ };+ categoryBalls.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_balls.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Balls"), reference: Reference.Category, objectId: categoryBalls.Id)).Id;+ allCategories.Add(categoryBalls);- var categoryDigitalDownloads = new Category- {- Name = "Digital downloads",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- ParentCategoryId = "",- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- IncludeInMenu = true,- Published = true,- ShowOnHomePage = false,- DisplayOrder = 400- };- categoryDigitalDownloads.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_digital_downloads.jpeg"), "image/jpeg", pictureService.GetPictureSeName("Digital downloads"), reference: Domain.Common.Reference.Category, objectId: categoryDigitalDownloads.Id)).Id;- allCategories.Add(categoryDigitalDownloads);+ var categoryDigitalDownloads = new Category {+ Name = "Digital downloads",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ ParentCategoryId = "",+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ IncludeInMenu = true,+ Published = true,+ ShowOnHomePage = false,+ DisplayOrder = 400+ };+ categoryDigitalDownloads.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_digital_downloads.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName("Digital downloads"), reference: Reference.Category,+ objectId: categoryDigitalDownloads.Id)).Id;+ allCategories.Add(categoryDigitalDownloads);- var categoryLego = new Category- {- Name = "Lego",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- MetaKeywords = "Lego, Dictionary, Textbooks",- MetaDescription = "Books category description",- PageSize = 6,- ParentCategoryId = "",- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- IncludeInMenu = true,- Published = true,- ShowOnHomePage = true,- DisplayOrder = 500,- Flag = "Promo!",- FlagStyle = "bg-success"- };- categoryLego.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_lego.jpeg"), "image/jpeg", pictureService.GetPictureSeName(categoryLego.Name), reference: Domain.Common.Reference.Category, objectId: categoryLego.Id)).Id;- allCategories.Add(categoryLego);+ var categoryLego = new Category {+ Name = "Lego",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ MetaKeywords = "Lego, Dictionary, Textbooks",+ MetaDescription = "Books category description",+ PageSize = 6,+ ParentCategoryId = "",+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ IncludeInMenu = true,+ Published = true,+ ShowOnHomePage = true,+ DisplayOrder = 500,+ Flag = "Promo!",+ FlagStyle = "bg-success"+ };+ categoryLego.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_lego.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName(categoryLego.Name), reference: Reference.Category,+ objectId: categoryLego.Id)).Id;+ allCategories.Add(categoryLego);- var categoryGiftVouchers = new Category- {- Name = "Gift vouchers",- CategoryLayoutId = categoryLayoutInGridAndLines.Id,- PageSize = 6,- ParentCategoryId = "",- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9",- IncludeInMenu = true,- Published = true,- DisplayOrder = 600- };- categoryGiftVouchers.PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "category_gift_cards.jpeg"), "image/jpeg", pictureService.GetPictureSeName(categoryGiftVouchers.Name), reference: Domain.Common.Reference.Category, objectId: categoryGiftVouchers.Id)).Id;- allCategories.Add(categoryGiftVouchers);+ var categoryGiftVouchers = new Category {+ Name = "Gift vouchers",+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,+ PageSize = 6,+ ParentCategoryId = "",+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9",+ IncludeInMenu = true,+ Published = true,+ DisplayOrder = 600+ };+ categoryGiftVouchers.PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "category_gift_cards.jpeg"), "image/jpeg",+ pictureService.GetPictureSeName(categoryGiftVouchers.Name), reference: Reference.Category,+ objectId: categoryGiftVouchers.Id)).Id;+ allCategories.Add(categoryGiftVouchers);- allCategories.ForEach(x=>_categoryRepository.Insert(x));+ allCategories.ForEach(x => _categoryRepository.Insert(x));- //search engine names- foreach (var category in allCategories)- {- category.SeName = SeoExtensions.GenerateSlug(category.Name, false, false, false);- await _entityUrlRepository.InsertAsync(new EntityUrl- {- EntityId = category.Id,- EntityName = "Category",- LanguageId = "",- IsActive = true,- Slug = category.SeName- });- await _categoryRepository.UpdateAsync(category);- }+ //search engine names+ foreach (var category in allCategories)+ {+ category.SeName = SeoExtensions.GenerateSlug(category.Name, false, false, false);+ await _entityUrlRepository.InsertAsync(new EntityUrl {+ EntityId = category.Id,+ EntityName = "Category",+ LanguageId = "",+ IsActive = true,+ Slug = category.SeName+ });+ await _categoryRepository.UpdateAsync(category);}}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCategoryLayouts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataCategoryLayouts.csindex 047af016b..169a969f8 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataCategoryLayouts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataCategoryLayouts.cs@@ -1,23 +1,19 @@using Grand.Domain.Catalog;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallCategoryLayouts(){- protected virtual Task InstallCategoryLayouts()- {- var categoryLayouts = new List<CategoryLayout>- {- new CategoryLayout- {- Name = "Grid or Lines",- ViewPath = "CategoryLayout.GridOrLines",- DisplayOrder = 1- }- };- categoryLayouts.ForEach(x=>_categoryLayoutRepository.Insert(x));- return Task.CompletedTask;-- }+ var categoryLayouts = new List<CategoryLayout> {+ new() {+ Name = "Grid or Lines",+ ViewPath = "CategoryLayout.GridOrLines",+ DisplayOrder = 1+ }+ };+ categoryLayouts.ForEach(x => _categoryLayoutRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCheckoutAttributes.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataCheckoutAttributes.csindex 29e717216..8c1ff8577 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataCheckoutAttributes.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataCheckoutAttributes.cs@@ -1,38 +1,34 @@using Grand.Domain.Catalog;using Grand.Domain.Orders;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallCheckoutAttributes(){- protected virtual async Task InstallCheckoutAttributes()- {- var ca1 = new CheckoutAttribute- {- Name = "Gift wrapping",- IsRequired = true,- ShippableProductRequired = true,- AttributeControlTypeId = AttributeControlType.DropdownList,- DisplayOrder = 1- };- await _checkoutAttributeRepository.InsertAsync(ca1);- ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue- {- Name = "No",- PriceAdjustment = 0,- DisplayOrder = 1,- IsPreSelected = true,- CheckoutAttributeId = ca1.Id- });+ var ca1 = new CheckoutAttribute {+ Name = "Gift wrapping",+ IsRequired = true,+ ShippableProductRequired = true,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ DisplayOrder = 1+ };+ await _checkoutAttributeRepository.InsertAsync(ca1);+ ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue {+ Name = "No",+ PriceAdjustment = 0,+ DisplayOrder = 1,+ IsPreSelected = true,+ CheckoutAttributeId = ca1.Id+ });- ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue- {- Name = "Yes",- PriceAdjustment = 10,- DisplayOrder = 2,- CheckoutAttributeId = ca1.Id- });- await _checkoutAttributeRepository.UpdateAsync(ca1);- }+ ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue {+ Name = "Yes",+ PriceAdjustment = 10,+ DisplayOrder = 2,+ CheckoutAttributeId = ca1.Id+ });+ await _checkoutAttributeRepository.UpdateAsync(ca1);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCollectionLayouts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataCollectionLayouts.csindex 19c021587..e3a7c6f08 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataCollectionLayouts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataCollectionLayouts.cs@@ -1,22 +1,19 @@using Grand.Domain.Catalog;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallCollectionLayouts(){- protected virtual Task InstallCollectionLayouts()- {- var collectionLayouts = new List<CollectionLayout>- {- new CollectionLayout- {- Name = "Grid or Lines",- ViewPath = "CollectionLayout.GridOrLines",- DisplayOrder = 1- }- };- collectionLayouts.ForEach(x=>_collectionLayoutRepository.Insert(x));- return Task.CompletedTask;- }+ var collectionLayouts = new List<CollectionLayout> {+ new() {+ Name = "Grid or Lines",+ ViewPath = "CollectionLayout.GridOrLines",+ DisplayOrder = 1+ }+ };+ collectionLayouts.ForEach(x => _collectionLayoutRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCountriesAndStates.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataCountriesAndStates.csindex 8b24bba13..7926f7097 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataCountriesAndStates.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataCountriesAndStates.cs@@ -1,3486 +1,3173 @@using Grand.Domain.Directory;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallCountriesAndStates(){- protected virtual async Task InstallCountriesAndStates()- {- var cUsa = new Country- {- Name = "United States",+ var cUsa = new Country {+ Name = "United States",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "US",+ ThreeLetterIsoCode = "USA",+ NumericIsoCode = 840,+ SubjectToVat = false,+ DisplayOrder = 1,+ Published = true+ };++ cUsa.StateProvinces.Add(new StateProvince {+ Name = "AA (Armed Forces Americas)",+ Abbreviation = "AA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "AE (Armed Forces Europe)",+ Abbreviation = "AE",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Alabama",+ Abbreviation = "AL",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Alaska",+ Abbreviation = "AK",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "American Samoa",+ Abbreviation = "AS",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "AP (Armed Forces Pacific)",+ Abbreviation = "AP",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Arizona",+ Abbreviation = "AZ",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Arkansas",+ Abbreviation = "AR",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "California",+ Abbreviation = "CA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Colorado",+ Abbreviation = "CO",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Connecticut",+ Abbreviation = "CT",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Delaware",+ Abbreviation = "DE",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "District of Columbia",+ Abbreviation = "DC",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Federated States of Micronesia",+ Abbreviation = "FM",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Florida",+ Abbreviation = "FL",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Georgia",+ Abbreviation = "GA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Guam",+ Abbreviation = "GU",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Hawaii",+ Abbreviation = "HI",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Idaho",+ Abbreviation = "ID",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Illinois",+ Abbreviation = "IL",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Indiana",+ Abbreviation = "IN",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Iowa",+ Abbreviation = "IA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Kansas",+ Abbreviation = "KS",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Kentucky",+ Abbreviation = "KY",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Louisiana",+ Abbreviation = "LA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Maine",+ Abbreviation = "ME",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Marshall Islands",+ Abbreviation = "MH",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Maryland",+ Abbreviation = "MD",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Massachusetts",+ Abbreviation = "MA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Michigan",+ Abbreviation = "MI",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Minnesota",+ Abbreviation = "MN",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Mississippi",+ Abbreviation = "MS",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Missouri",+ Abbreviation = "MO",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Montana",+ Abbreviation = "MT",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Nebraska",+ Abbreviation = "NE",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Nevada",+ Abbreviation = "NV",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "New Hampshire",+ Abbreviation = "NH",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "New Jersey",+ Abbreviation = "NJ",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "New Mexico",+ Abbreviation = "NM",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "New York",+ Abbreviation = "NY",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "North Carolina",+ Abbreviation = "NC",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "North Dakota",+ Abbreviation = "ND",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Northern Mariana Islands",+ Abbreviation = "MP",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Ohio",+ Abbreviation = "OH",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Oklahoma",+ Abbreviation = "OK",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Oregon",+ Abbreviation = "OR",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Palau",+ Abbreviation = "PW",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Pennsylvania",+ Abbreviation = "PA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Puerto Rico",+ Abbreviation = "PR",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Rhode Island",+ Abbreviation = "RI",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "South Carolina",+ Abbreviation = "SC",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "South Dakota",+ Abbreviation = "SD",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Tennessee",+ Abbreviation = "TN",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Texas",+ Abbreviation = "TX",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Utah",+ Abbreviation = "UT",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Vermont",+ Abbreviation = "VT",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Virgin Islands",+ Abbreviation = "VI",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Virginia",+ Abbreviation = "VA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Washington",+ Abbreviation = "WA",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "West Virginia",+ Abbreviation = "WV",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Wisconsin",+ Abbreviation = "WI",+ Published = true,+ DisplayOrder = 1+ });+ cUsa.StateProvinces.Add(new StateProvince {+ Name = "Wyoming",+ Abbreviation = "WY",+ Published = true,+ DisplayOrder = 1+ });+ await _countryRepository.InsertAsync(cUsa);++ var cCanada = new Country {+ Name = "Canada",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CA",+ ThreeLetterIsoCode = "CAN",+ NumericIsoCode = 124,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ };+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Alberta",+ Abbreviation = "AB",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "British Columbia",+ Abbreviation = "BC",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Manitoba",+ Abbreviation = "MB",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "New Brunswick",+ Abbreviation = "NB",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Newfoundland and Labrador",+ Abbreviation = "NL",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Northwest Territories",+ Abbreviation = "NT",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Nova Scotia",+ Abbreviation = "NS",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Nunavut",+ Abbreviation = "NU",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Ontario",+ Abbreviation = "ON",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Prince Edward Island",+ Abbreviation = "PE",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Quebec",+ Abbreviation = "QC",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Saskatchewan",+ Abbreviation = "SK",+ Published = true,+ DisplayOrder = 1+ });+ cCanada.StateProvinces.Add(new StateProvince {+ Name = "Yukon Territory",+ Abbreviation = "YT",+ Published = true,+ DisplayOrder = 1+ });+ await _countryRepository.InsertAsync(cCanada);++ var cPoland = new Country {+ Name = "Poland",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PL",+ ThreeLetterIsoCode = "POL",+ NumericIsoCode = 616,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ };+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 0,+ Name = "dolnośląskie",+ Published = true,+ Abbreviation = "DŚ"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 1,+ Name = "kujawsko-pomorskie",+ Published = true,+ Abbreviation = "KP"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 2,+ Name = "lubelskie",+ Published = true,+ Abbreviation = "LB"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 3,+ Name = "lubuskie",+ Published = true,+ Abbreviation = "LS"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 4,+ Name = "łódzkie",+ Published = true,+ Abbreviation = "ŁD"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 5,+ Name = "małopolskie",+ Published = true,+ Abbreviation = "MP"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 6,+ Name = "mazowieckie",+ Published = true,+ Abbreviation = "MZ"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 7,+ Name = "opolskie",+ Published = true,+ Abbreviation = "OP"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 8,+ Name = "podkarpackie",+ Published = true,+ Abbreviation = "PK"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 9,+ Name = "podlaskie",+ Published = true,+ Abbreviation = "PL"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 10,+ Name = "pomorskie",+ Published = true,+ Abbreviation = "PM"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 11,+ Name = "śląskie",+ Published = true,+ Abbreviation = "ŚL"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 12,+ Name = "świętokrzyskie",+ Published = true,+ Abbreviation = "ŚK"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 13,+ Name = "warmińsko-mazurskie",+ Published = true,+ Abbreviation = "WM"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 14,+ Name = "wielkopolskie",+ Published = true,+ Abbreviation = "WP"+ });+ cPoland.StateProvinces.Add(new StateProvince {+ DisplayOrder = 15,+ Name = "zachodniopomorskie",+ Published = true,+ Abbreviation = "ZP"+ });++ var countries = new List<Country> {+ new() {+ Name = "Argentina",AllowsBilling = true,AllowsShipping = true,- TwoLetterIsoCode = "US",- ThreeLetterIsoCode = "USA",- NumericIsoCode = 840,+ TwoLetterIsoCode = "AR",+ ThreeLetterIsoCode = "ARG",+ NumericIsoCode = 32,SubjectToVat = false,- DisplayOrder = 1,+ DisplayOrder = 100,Published = true- };-- cUsa.StateProvinces.Add(new StateProvince- {- Name = "AA (Armed Forces Americas)",- Abbreviation = "AA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "AE (Armed Forces Europe)",- Abbreviation = "AE",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Alabama",- Abbreviation = "AL",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Alaska",- Abbreviation = "AK",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "American Samoa",- Abbreviation = "AS",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "AP (Armed Forces Pacific)",- Abbreviation = "AP",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Arizona",- Abbreviation = "AZ",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Arkansas",- Abbreviation = "AR",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "California",- Abbreviation = "CA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Colorado",- Abbreviation = "CO",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Connecticut",- Abbreviation = "CT",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Delaware",- Abbreviation = "DE",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "District of Columbia",- Abbreviation = "DC",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Federated States of Micronesia",- Abbreviation = "FM",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Florida",- Abbreviation = "FL",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {+ },+ new() {+ Name = "Armenia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AM",+ ThreeLetterIsoCode = "ARM",+ NumericIsoCode = 51,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Aruba",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AW",+ ThreeLetterIsoCode = "ABW",+ NumericIsoCode = 533,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Australia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AU",+ ThreeLetterIsoCode = "AUS",+ NumericIsoCode = 36,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Austria",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AT",+ ThreeLetterIsoCode = "AUT",+ NumericIsoCode = 40,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Azerbaijan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AZ",+ ThreeLetterIsoCode = "AZE",+ NumericIsoCode = 31,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bahamas",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BS",+ ThreeLetterIsoCode = "BHS",+ NumericIsoCode = 44,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bangladesh",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BD",+ ThreeLetterIsoCode = "BGD",+ NumericIsoCode = 50,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Belarus",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BY",+ ThreeLetterIsoCode = "BLR",+ NumericIsoCode = 112,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Belgium",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BE",+ ThreeLetterIsoCode = "BEL",+ NumericIsoCode = 56,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Belize",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BZ",+ ThreeLetterIsoCode = "BLZ",+ NumericIsoCode = 84,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bermuda",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BM",+ ThreeLetterIsoCode = "BMU",+ NumericIsoCode = 60,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bolivia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BO",+ ThreeLetterIsoCode = "BOL",+ NumericIsoCode = 68,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bosnia and Herzegowina",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BA",+ ThreeLetterIsoCode = "BIH",+ NumericIsoCode = 70,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Brazil",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BR",+ ThreeLetterIsoCode = "BRA",+ NumericIsoCode = 76,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bulgaria",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BG",+ ThreeLetterIsoCode = "BGR",+ NumericIsoCode = 100,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cayman Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KY",+ ThreeLetterIsoCode = "CYM",+ NumericIsoCode = 136,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Chile",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CL",+ ThreeLetterIsoCode = "CHL",+ NumericIsoCode = 152,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "China",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CN",+ ThreeLetterIsoCode = "CHN",+ NumericIsoCode = 156,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Colombia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CO",+ ThreeLetterIsoCode = "COL",+ NumericIsoCode = 170,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Costa Rica",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CR",+ ThreeLetterIsoCode = "CRI",+ NumericIsoCode = 188,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Croatia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "HR",+ ThreeLetterIsoCode = "HRV",+ NumericIsoCode = 191,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cuba",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CU",+ ThreeLetterIsoCode = "CUB",+ NumericIsoCode = 192,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cyprus",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CY",+ ThreeLetterIsoCode = "CYP",+ NumericIsoCode = 196,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Czech Republic",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CZ",+ ThreeLetterIsoCode = "CZE",+ NumericIsoCode = 203,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Denmark",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "DK",+ ThreeLetterIsoCode = "DNK",+ NumericIsoCode = 208,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Dominican Republic",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "DO",+ ThreeLetterIsoCode = "DOM",+ NumericIsoCode = 214,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Ecuador",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "EC",+ ThreeLetterIsoCode = "ECU",+ NumericIsoCode = 218,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Egypt",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "EG",+ ThreeLetterIsoCode = "EGY",+ NumericIsoCode = 818,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Finland",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "FI",+ ThreeLetterIsoCode = "FIN",+ NumericIsoCode = 246,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "France",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "FR",+ ThreeLetterIsoCode = "FRA",+ NumericIsoCode = 250,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {Name = "Georgia",- Abbreviation = "GA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Guam",- Abbreviation = "GU",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Hawaii",- Abbreviation = "HI",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Idaho",- Abbreviation = "ID",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Illinois",- Abbreviation = "IL",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Indiana",- Abbreviation = "IN",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Iowa",- Abbreviation = "IA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Kansas",- Abbreviation = "KS",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Kentucky",- Abbreviation = "KY",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Louisiana",- Abbreviation = "LA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Maine",- Abbreviation = "ME",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Marshall Islands",- Abbreviation = "MH",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Maryland",- Abbreviation = "MD",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Massachusetts",- Abbreviation = "MA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Michigan",- Abbreviation = "MI",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Minnesota",- Abbreviation = "MN",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Mississippi",- Abbreviation = "MS",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Missouri",- Abbreviation = "MO",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Montana",- Abbreviation = "MT",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Nebraska",- Abbreviation = "NE",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Nevada",- Abbreviation = "NV",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "New Hampshire",- Abbreviation = "NH",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "New Jersey",- Abbreviation = "NJ",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "New Mexico",- Abbreviation = "NM",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "New York",- Abbreviation = "NY",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "North Carolina",- Abbreviation = "NC",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "North Dakota",- Abbreviation = "ND",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Northern Mariana Islands",- Abbreviation = "MP",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Ohio",- Abbreviation = "OH",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Oklahoma",- Abbreviation = "OK",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Oregon",- Abbreviation = "OR",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Palau",- Abbreviation = "PW",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Pennsylvania",- Abbreviation = "PA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Puerto Rico",- Abbreviation = "PR",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Rhode Island",- Abbreviation = "RI",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "South Carolina",- Abbreviation = "SC",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "South Dakota",- Abbreviation = "SD",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Tennessee",- Abbreviation = "TN",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Texas",- Abbreviation = "TX",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Utah",- Abbreviation = "UT",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Vermont",- Abbreviation = "VT",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Virgin Islands",- Abbreviation = "VI",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Virginia",- Abbreviation = "VA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Washington",- Abbreviation = "WA",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "West Virginia",- Abbreviation = "WV",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Wisconsin",- Abbreviation = "WI",- Published = true,- DisplayOrder = 1- });- cUsa.StateProvinces.Add(new StateProvince- {- Name = "Wyoming",- Abbreviation = "WY",- Published = true,- DisplayOrder = 1- });- await _countryRepository.InsertAsync(cUsa);-- var cCanada = new Country- {- Name = "Canada",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CA",- ThreeLetterIsoCode = "CAN",- NumericIsoCode = 124,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- };- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Alberta",- Abbreviation = "AB",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "British Columbia",- Abbreviation = "BC",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Manitoba",- Abbreviation = "MB",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "New Brunswick",- Abbreviation = "NB",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Newfoundland and Labrador",- Abbreviation = "NL",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Northwest Territories",- Abbreviation = "NT",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Nova Scotia",- Abbreviation = "NS",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Nunavut",- Abbreviation = "NU",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Ontario",- Abbreviation = "ON",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Prince Edward Island",- Abbreviation = "PE",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Quebec",- Abbreviation = "QC",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Saskatchewan",- Abbreviation = "SK",- Published = true,- DisplayOrder = 1- });- cCanada.StateProvinces.Add(new StateProvince- {- Name = "Yukon Territory",- Abbreviation = "YT",- Published = true,- DisplayOrder = 1- });- await _countryRepository.InsertAsync(cCanada);-- var cPoland = new Country {- Name = "Poland",AllowsBilling = true,AllowsShipping = true,- TwoLetterIsoCode = "PL",- ThreeLetterIsoCode = "POL",- NumericIsoCode = 616,+ TwoLetterIsoCode = "GE",+ ThreeLetterIsoCode = "GEO",+ NumericIsoCode = 268,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Germany",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "DE",+ ThreeLetterIsoCode = "DEU",+ NumericIsoCode = 276,SubjectToVat = true,DisplayOrder = 100,Published = true- };- cPoland.StateProvinces.Add(new () {- DisplayOrder = 0,- Name = "dolnośląskie",- Published = true,- Abbreviation = "DŚ"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 1,- Name = "kujawsko-pomorskie",- Published = true,- Abbreviation = "KP"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 2,- Name = "lubelskie",- Published = true,- Abbreviation = "LB"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 3,- Name = "lubuskie",- Published = true,- Abbreviation = "LS"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 4,- Name = "łódzkie",- Published = true,- Abbreviation = "ŁD"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 5,- Name = "małopolskie",- Published = true,- Abbreviation = "MP"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 6,- Name = "mazowieckie",- Published = true,- Abbreviation = "MZ"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 7,- Name = "opolskie",- Published = true,- Abbreviation = "OP"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 8,- Name = "podkarpackie",- Published = true,- Abbreviation = "PK"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 9,- Name = "podlaskie",- Published = true,- Abbreviation = "PL"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 10,- Name = "pomorskie",- Published = true,- Abbreviation = "PM"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 11,- Name = "śląskie",- Published = true,- Abbreviation = "ŚL"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 12,- Name = "świętokrzyskie",- Published = true,- Abbreviation = "ŚK"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 13,- Name = "warmińsko-mazurskie",- Published = true,- Abbreviation = "WM"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 14,- Name = "wielkopolskie",- Published = true,- Abbreviation = "WP"- });- cPoland.StateProvinces.Add(new () {- DisplayOrder = 15,- Name = "zachodniopomorskie",- Published = true,- Abbreviation = "ZP"- });-- var countries = new List<Country>- {- new Country- {- Name = "Argentina",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AR",- ThreeLetterIsoCode = "ARG",- NumericIsoCode = 32,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Armenia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AM",- ThreeLetterIsoCode = "ARM",- NumericIsoCode = 51,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Aruba",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AW",- ThreeLetterIsoCode = "ABW",- NumericIsoCode = 533,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Australia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AU",- ThreeLetterIsoCode = "AUS",- NumericIsoCode = 36,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Austria",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AT",- ThreeLetterIsoCode = "AUT",- NumericIsoCode = 40,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Azerbaijan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AZ",- ThreeLetterIsoCode = "AZE",- NumericIsoCode = 31,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bahamas",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BS",- ThreeLetterIsoCode = "BHS",- NumericIsoCode = 44,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bangladesh",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BD",- ThreeLetterIsoCode = "BGD",- NumericIsoCode = 50,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Belarus",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BY",- ThreeLetterIsoCode = "BLR",- NumericIsoCode = 112,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Belgium",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BE",- ThreeLetterIsoCode = "BEL",- NumericIsoCode = 56,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Belize",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BZ",- ThreeLetterIsoCode = "BLZ",- NumericIsoCode = 84,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bermuda",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BM",- ThreeLetterIsoCode = "BMU",- NumericIsoCode = 60,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bolivia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BO",- ThreeLetterIsoCode = "BOL",- NumericIsoCode = 68,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bosnia and Herzegowina",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BA",- ThreeLetterIsoCode = "BIH",- NumericIsoCode = 70,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Brazil",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BR",- ThreeLetterIsoCode = "BRA",- NumericIsoCode = 76,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bulgaria",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BG",- ThreeLetterIsoCode = "BGR",- NumericIsoCode = 100,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cayman Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KY",- ThreeLetterIsoCode = "CYM",- NumericIsoCode = 136,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Chile",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CL",- ThreeLetterIsoCode = "CHL",- NumericIsoCode = 152,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "China",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CN",- ThreeLetterIsoCode = "CHN",- NumericIsoCode = 156,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Colombia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CO",- ThreeLetterIsoCode = "COL",- NumericIsoCode = 170,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Costa Rica",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CR",- ThreeLetterIsoCode = "CRI",- NumericIsoCode = 188,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Croatia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "HR",- ThreeLetterIsoCode = "HRV",- NumericIsoCode = 191,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cuba",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CU",- ThreeLetterIsoCode = "CUB",- NumericIsoCode = 192,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cyprus",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CY",- ThreeLetterIsoCode = "CYP",- NumericIsoCode = 196,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Czech Republic",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CZ",- ThreeLetterIsoCode = "CZE",- NumericIsoCode = 203,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Denmark",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "DK",- ThreeLetterIsoCode = "DNK",- NumericIsoCode = 208,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Dominican Republic",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "DO",- ThreeLetterIsoCode = "DOM",- NumericIsoCode = 214,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Ecuador",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "EC",- ThreeLetterIsoCode = "ECU",- NumericIsoCode = 218,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Egypt",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "EG",- ThreeLetterIsoCode = "EGY",- NumericIsoCode = 818,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Finland",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "FI",- ThreeLetterIsoCode = "FIN",- NumericIsoCode = 246,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "France",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "FR",- ThreeLetterIsoCode = "FRA",- NumericIsoCode = 250,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Georgia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GE",- ThreeLetterIsoCode = "GEO",- NumericIsoCode = 268,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Germany",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "DE",- ThreeLetterIsoCode = "DEU",- NumericIsoCode = 276,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Gibraltar",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GI",- ThreeLetterIsoCode = "GIB",- NumericIsoCode = 292,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Greece",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GR",- ThreeLetterIsoCode = "GRC",- NumericIsoCode = 300,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Guatemala",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GT",- ThreeLetterIsoCode = "GTM",- NumericIsoCode = 320,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Hong Kong",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "HK",- ThreeLetterIsoCode = "HKG",- NumericIsoCode = 344,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Hungary",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "HU",- ThreeLetterIsoCode = "HUN",- NumericIsoCode = 348,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "India",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IN",- ThreeLetterIsoCode = "IND",- NumericIsoCode = 356,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Indonesia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ID",- ThreeLetterIsoCode = "IDN",- NumericIsoCode = 360,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Ireland",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IE",- ThreeLetterIsoCode = "IRL",- NumericIsoCode = 372,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Israel",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IL",- ThreeLetterIsoCode = "ISR",- NumericIsoCode = 376,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Italy",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IT",- ThreeLetterIsoCode = "ITA",- NumericIsoCode = 380,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Jamaica",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "JM",- ThreeLetterIsoCode = "JAM",- NumericIsoCode = 388,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Japan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "JP",- ThreeLetterIsoCode = "JPN",- NumericIsoCode = 392,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Jordan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "JO",- ThreeLetterIsoCode = "JOR",- NumericIsoCode = 400,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Kazakhstan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KZ",- ThreeLetterIsoCode = "KAZ",- NumericIsoCode = 398,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Korea, Democratic People's Republic of",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KP",- ThreeLetterIsoCode = "PRK",- NumericIsoCode = 408,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Kuwait",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KW",- ThreeLetterIsoCode = "KWT",- NumericIsoCode = 414,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Malaysia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MY",- ThreeLetterIsoCode = "MYS",- NumericIsoCode = 458,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Mexico",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MX",- ThreeLetterIsoCode = "MEX",- NumericIsoCode = 484,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Netherlands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NL",- ThreeLetterIsoCode = "NLD",- NumericIsoCode = 528,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "New Zealand",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NZ",- ThreeLetterIsoCode = "NZL",- NumericIsoCode = 554,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Norway",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NO",- ThreeLetterIsoCode = "NOR",- NumericIsoCode = 578,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Pakistan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PK",- ThreeLetterIsoCode = "PAK",- NumericIsoCode = 586,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Paraguay",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PY",- ThreeLetterIsoCode = "PRY",- NumericIsoCode = 600,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Peru",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PE",- ThreeLetterIsoCode = "PER",- NumericIsoCode = 604,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Philippines",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PH",- ThreeLetterIsoCode = "PHL",- NumericIsoCode = 608,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- cPoland,- new Country- {- Name = "Portugal",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PT",- ThreeLetterIsoCode = "PRT",- NumericIsoCode = 620,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Puerto Rico",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PR",- ThreeLetterIsoCode = "PRI",- NumericIsoCode = 630,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Qatar",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "QA",- ThreeLetterIsoCode = "QAT",- NumericIsoCode = 634,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Romania",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "RO",- ThreeLetterIsoCode = "ROM",- NumericIsoCode = 642,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Russia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "RU",- ThreeLetterIsoCode = "RUS",- NumericIsoCode = 643,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Saudi Arabia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SA",- ThreeLetterIsoCode = "SAU",- NumericIsoCode = 682,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Singapore",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SG",- ThreeLetterIsoCode = "SGP",- NumericIsoCode = 702,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Slovakia (Slovak Republic)",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SK",- ThreeLetterIsoCode = "SVK",- NumericIsoCode = 703,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Slovenia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SI",- ThreeLetterIsoCode = "SVN",- NumericIsoCode = 705,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "South Africa",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ZA",- ThreeLetterIsoCode = "ZAF",- NumericIsoCode = 710,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Spain",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ES",- ThreeLetterIsoCode = "ESP",- NumericIsoCode = 724,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Sweden",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SE",- ThreeLetterIsoCode = "SWE",- NumericIsoCode = 752,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Switzerland",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CH",- ThreeLetterIsoCode = "CHE",- NumericIsoCode = 756,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Taiwan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TW",- ThreeLetterIsoCode = "TWN",- NumericIsoCode = 158,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Thailand",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TH",- ThreeLetterIsoCode = "THA",- NumericIsoCode = 764,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Turkey",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TR",- ThreeLetterIsoCode = "TUR",- NumericIsoCode = 792,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Ukraine",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "UA",- ThreeLetterIsoCode = "UKR",- NumericIsoCode = 804,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "United Arab Emirates",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AE",- ThreeLetterIsoCode = "ARE",- NumericIsoCode = 784,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "United Kingdom",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GB",- ThreeLetterIsoCode = "GBR",- NumericIsoCode = 826,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "United States minor outlying islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "UM",- ThreeLetterIsoCode = "UMI",- NumericIsoCode = 581,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Uruguay",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "UY",- ThreeLetterIsoCode = "URY",- NumericIsoCode = 858,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Uzbekistan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "UZ",- ThreeLetterIsoCode = "UZB",- NumericIsoCode = 860,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Venezuela",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "VE",- ThreeLetterIsoCode = "VEN",- NumericIsoCode = 862,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Serbia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "RS",- ThreeLetterIsoCode = "SRB",- NumericIsoCode = 688,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Afghanistan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AF",- ThreeLetterIsoCode = "AFG",- NumericIsoCode = 4,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Albania",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AL",- ThreeLetterIsoCode = "ALB",- NumericIsoCode = 8,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Algeria",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "DZ",- ThreeLetterIsoCode = "DZA",- NumericIsoCode = 12,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "American Samoa",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AS",- ThreeLetterIsoCode = "ASM",- NumericIsoCode = 16,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Andorra",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AD",- ThreeLetterIsoCode = "AND",- NumericIsoCode = 20,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Angola",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AO",- ThreeLetterIsoCode = "AGO",- NumericIsoCode = 24,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Anguilla",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AI",- ThreeLetterIsoCode = "AIA",- NumericIsoCode = 660,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Antarctica",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AQ",- ThreeLetterIsoCode = "ATA",- NumericIsoCode = 10,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Antigua and Barbuda",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AG",- ThreeLetterIsoCode = "ATG",- NumericIsoCode = 28,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bahrain",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BH",- ThreeLetterIsoCode = "BHR",- NumericIsoCode = 48,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Barbados",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BB",- ThreeLetterIsoCode = "BRB",- NumericIsoCode = 52,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Benin",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BJ",- ThreeLetterIsoCode = "BEN",- NumericIsoCode = 204,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bhutan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BT",- ThreeLetterIsoCode = "BTN",- NumericIsoCode = 64,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Botswana",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BW",- ThreeLetterIsoCode = "BWA",- NumericIsoCode = 72,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Bouvet Island",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BV",- ThreeLetterIsoCode = "BVT",- NumericIsoCode = 74,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "British Indian Ocean Territory",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IO",- ThreeLetterIsoCode = "IOT",- NumericIsoCode = 86,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Brunei Darussalam",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BN",- ThreeLetterIsoCode = "BRN",- NumericIsoCode = 96,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Burkina Faso",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BF",- ThreeLetterIsoCode = "BFA",- NumericIsoCode = 854,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Burundi",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "BI",- ThreeLetterIsoCode = "BDI",- NumericIsoCode = 108,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cambodia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KH",- ThreeLetterIsoCode = "KHM",- NumericIsoCode = 116,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cameroon",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CM",- ThreeLetterIsoCode = "CMR",- NumericIsoCode = 120,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cape Verde",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CV",- ThreeLetterIsoCode = "CPV",- NumericIsoCode = 132,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Central African Republic",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CF",- ThreeLetterIsoCode = "CAF",- NumericIsoCode = 140,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Chad",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TD",- ThreeLetterIsoCode = "TCD",- NumericIsoCode = 148,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Christmas Island",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CX",- ThreeLetterIsoCode = "CXR",- NumericIsoCode = 162,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cocos (Keeling) Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CC",- ThreeLetterIsoCode = "CCK",- NumericIsoCode = 166,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Comoros",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KM",- ThreeLetterIsoCode = "COM",- NumericIsoCode = 174,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Congo",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CG",- ThreeLetterIsoCode = "COG",- NumericIsoCode = 178,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cook Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CK",- ThreeLetterIsoCode = "COK",- NumericIsoCode = 184,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Cote D'Ivoire",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "CI",- ThreeLetterIsoCode = "CIV",- NumericIsoCode = 384,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Djibouti",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "DJ",- ThreeLetterIsoCode = "DJI",- NumericIsoCode = 262,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Dominica",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "DM",- ThreeLetterIsoCode = "DMA",- NumericIsoCode = 212,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "El Salvador",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SV",- ThreeLetterIsoCode = "SLV",- NumericIsoCode = 222,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Equatorial Guinea",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GQ",- ThreeLetterIsoCode = "GNQ",- NumericIsoCode = 226,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Eritrea",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ER",- ThreeLetterIsoCode = "ERI",- NumericIsoCode = 232,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Estonia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "EE",- ThreeLetterIsoCode = "EST",- NumericIsoCode = 233,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Ethiopia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ET",- ThreeLetterIsoCode = "ETH",- NumericIsoCode = 231,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Falkland Islands (Malvinas)",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "FK",- ThreeLetterIsoCode = "FLK",- NumericIsoCode = 238,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Faroe Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "FO",- ThreeLetterIsoCode = "FRO",- NumericIsoCode = 234,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Fiji",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "FJ",- ThreeLetterIsoCode = "FJI",- NumericIsoCode = 242,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "French Guiana",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GF",- ThreeLetterIsoCode = "GUF",- NumericIsoCode = 254,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "French Polynesia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PF",- ThreeLetterIsoCode = "PYF",- NumericIsoCode = 258,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "French Southern Territories",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TF",- ThreeLetterIsoCode = "ATF",- NumericIsoCode = 260,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Gabon",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GA",- ThreeLetterIsoCode = "GAB",- NumericIsoCode = 266,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Gambia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GM",- ThreeLetterIsoCode = "GMB",- NumericIsoCode = 270,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Ghana",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GH",- ThreeLetterIsoCode = "GHA",- NumericIsoCode = 288,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Greenland",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GL",- ThreeLetterIsoCode = "GRL",- NumericIsoCode = 304,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Grenada",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GD",- ThreeLetterIsoCode = "GRD",- NumericIsoCode = 308,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Guadeloupe",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GP",- ThreeLetterIsoCode = "GLP",- NumericIsoCode = 312,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Guam",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GU",- ThreeLetterIsoCode = "GUM",- NumericIsoCode = 316,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Guinea",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GN",- ThreeLetterIsoCode = "GIN",- NumericIsoCode = 324,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Guinea-bissau",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GW",- ThreeLetterIsoCode = "GNB",- NumericIsoCode = 624,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Guyana",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GY",- ThreeLetterIsoCode = "GUY",- NumericIsoCode = 328,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Haiti",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "HT",- ThreeLetterIsoCode = "HTI",- NumericIsoCode = 332,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Heard and Mc Donald Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "HM",- ThreeLetterIsoCode = "HMD",- NumericIsoCode = 334,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Honduras",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "HN",- ThreeLetterIsoCode = "HND",- NumericIsoCode = 340,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Iceland",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IS",- ThreeLetterIsoCode = "ISL",- NumericIsoCode = 352,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Iran (Islamic Republic of)",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IR",- ThreeLetterIsoCode = "IRN",- NumericIsoCode = 364,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Iraq",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "IQ",- ThreeLetterIsoCode = "IRQ",- NumericIsoCode = 368,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Kenya",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KE",- ThreeLetterIsoCode = "KEN",- NumericIsoCode = 404,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Kiribati",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KI",- ThreeLetterIsoCode = "KIR",- NumericIsoCode = 296,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Korea",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KR",- ThreeLetterIsoCode = "KOR",- NumericIsoCode = 410,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Kyrgyzstan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KG",- ThreeLetterIsoCode = "KGZ",- NumericIsoCode = 417,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Lao People's Democratic Republic",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LA",- ThreeLetterIsoCode = "LAO",- NumericIsoCode = 418,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Latvia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LV",- ThreeLetterIsoCode = "LVA",- NumericIsoCode = 428,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Lebanon",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LB",- ThreeLetterIsoCode = "LBN",- NumericIsoCode = 422,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Lesotho",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LS",- ThreeLetterIsoCode = "LSO",- NumericIsoCode = 426,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Liberia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LR",- ThreeLetterIsoCode = "LBR",- NumericIsoCode = 430,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Libyan Arab Jamahiriya",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LY",- ThreeLetterIsoCode = "LBY",- NumericIsoCode = 434,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Liechtenstein",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LI",- ThreeLetterIsoCode = "LIE",- NumericIsoCode = 438,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Lithuania",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LT",- ThreeLetterIsoCode = "LTU",- NumericIsoCode = 440,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Luxembourg",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LU",- ThreeLetterIsoCode = "LUX",- NumericIsoCode = 442,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Macau",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MO",- ThreeLetterIsoCode = "MAC",- NumericIsoCode = 446,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Macedonia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MK",- ThreeLetterIsoCode = "MKD",- NumericIsoCode = 807,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Madagascar",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MG",- ThreeLetterIsoCode = "MDG",- NumericIsoCode = 450,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Malawi",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MW",- ThreeLetterIsoCode = "MWI",- NumericIsoCode = 454,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Maldives",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MV",- ThreeLetterIsoCode = "MDV",- NumericIsoCode = 462,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Mali",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ML",- ThreeLetterIsoCode = "MLI",- NumericIsoCode = 466,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Malta",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MT",- ThreeLetterIsoCode = "MLT",- NumericIsoCode = 470,- SubjectToVat = true,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Marshall Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MH",- ThreeLetterIsoCode = "MHL",- NumericIsoCode = 584,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Martinique",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MQ",- ThreeLetterIsoCode = "MTQ",- NumericIsoCode = 474,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Mauritania",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MR",- ThreeLetterIsoCode = "MRT",- NumericIsoCode = 478,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Mauritius",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MU",- ThreeLetterIsoCode = "MUS",- NumericIsoCode = 480,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Mayotte",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "YT",- ThreeLetterIsoCode = "MYT",- NumericIsoCode = 175,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Micronesia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "FM",- ThreeLetterIsoCode = "FSM",- NumericIsoCode = 583,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Moldova",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MD",- ThreeLetterIsoCode = "MDA",- NumericIsoCode = 498,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Monaco",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MC",- ThreeLetterIsoCode = "MCO",- NumericIsoCode = 492,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Mongolia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MN",- ThreeLetterIsoCode = "MNG",- NumericIsoCode = 496,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Montenegro",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ME",- ThreeLetterIsoCode = "MNE",- NumericIsoCode = 499,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Montserrat",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MS",- ThreeLetterIsoCode = "MSR",- NumericIsoCode = 500,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Morocco",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MA",- ThreeLetterIsoCode = "MAR",- NumericIsoCode = 504,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Mozambique",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MZ",- ThreeLetterIsoCode = "MOZ",- NumericIsoCode = 508,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Myanmar",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MM",- ThreeLetterIsoCode = "MMR",- NumericIsoCode = 104,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Namibia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NA",- ThreeLetterIsoCode = "NAM",- NumericIsoCode = 516,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Nauru",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NR",- ThreeLetterIsoCode = "NRU",- NumericIsoCode = 520,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Nepal",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NP",- ThreeLetterIsoCode = "NPL",- NumericIsoCode = 524,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Netherlands Antilles",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "AN",- ThreeLetterIsoCode = "ANT",- NumericIsoCode = 530,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "New Caledonia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NC",- ThreeLetterIsoCode = "NCL",- NumericIsoCode = 540,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Nicaragua",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NI",- ThreeLetterIsoCode = "NIC",- NumericIsoCode = 558,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Niger",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NE",- ThreeLetterIsoCode = "NER",- NumericIsoCode = 562,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Nigeria",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NG",- ThreeLetterIsoCode = "NGA",- NumericIsoCode = 566,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Niue",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NU",- ThreeLetterIsoCode = "NIU",- NumericIsoCode = 570,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Norfolk Island",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "NF",- ThreeLetterIsoCode = "NFK",- NumericIsoCode = 574,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Northern Mariana Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "MP",- ThreeLetterIsoCode = "MNP",- NumericIsoCode = 580,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Oman",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "OM",- ThreeLetterIsoCode = "OMN",- NumericIsoCode = 512,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Palau",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PW",- ThreeLetterIsoCode = "PLW",- NumericIsoCode = 585,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Panama",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PA",- ThreeLetterIsoCode = "PAN",- NumericIsoCode = 591,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Papua New Guinea",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PG",- ThreeLetterIsoCode = "PNG",- NumericIsoCode = 598,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Pitcairn",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PN",- ThreeLetterIsoCode = "PCN",- NumericIsoCode = 612,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Reunion",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "RE",- ThreeLetterIsoCode = "REU",- NumericIsoCode = 638,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Rwanda",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "RW",- ThreeLetterIsoCode = "RWA",- NumericIsoCode = 646,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Saint Kitts and Nevis",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "KN",- ThreeLetterIsoCode = "KNA",- NumericIsoCode = 659,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Saint Lucia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LC",- ThreeLetterIsoCode = "LCA",- NumericIsoCode = 662,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Saint Vincent and the Grenadines",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "VC",- ThreeLetterIsoCode = "VCT",- NumericIsoCode = 670,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Samoa",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "WS",- ThreeLetterIsoCode = "WSM",- NumericIsoCode = 882,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "San Marino",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SM",- ThreeLetterIsoCode = "SMR",- NumericIsoCode = 674,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Sao Tome and Principe",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ST",- ThreeLetterIsoCode = "STP",- NumericIsoCode = 678,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Senegal",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SN",- ThreeLetterIsoCode = "SEN",- NumericIsoCode = 686,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Seychelles",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SC",- ThreeLetterIsoCode = "SYC",- NumericIsoCode = 690,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Sierra Leone",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SL",- ThreeLetterIsoCode = "SLE",- NumericIsoCode = 694,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Solomon Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SB",- ThreeLetterIsoCode = "SLB",- NumericIsoCode = 90,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Somalia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SO",- ThreeLetterIsoCode = "SOM",- NumericIsoCode = 706,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "South Georgia & South Sandwich Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "GS",- ThreeLetterIsoCode = "SGS",- NumericIsoCode = 239,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Sri Lanka",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "LK",- ThreeLetterIsoCode = "LKA",- NumericIsoCode = 144,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "St. Helena",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SH",- ThreeLetterIsoCode = "SHN",- NumericIsoCode = 654,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "St. Pierre and Miquelon",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "PM",- ThreeLetterIsoCode = "SPM",- NumericIsoCode = 666,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Sudan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SD",- ThreeLetterIsoCode = "SDN",- NumericIsoCode = 736,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Suriname",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SR",- ThreeLetterIsoCode = "SUR",- NumericIsoCode = 740,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Svalbard and Jan Mayen Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SJ",- ThreeLetterIsoCode = "SJM",- NumericIsoCode = 744,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Swaziland",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SZ",- ThreeLetterIsoCode = "SWZ",- NumericIsoCode = 748,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Syrian Arab Republic",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "SY",- ThreeLetterIsoCode = "SYR",- NumericIsoCode = 760,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Tajikistan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TJ",- ThreeLetterIsoCode = "TJK",- NumericIsoCode = 762,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Tanzania",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TZ",- ThreeLetterIsoCode = "TZA",- NumericIsoCode = 834,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Togo",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TG",- ThreeLetterIsoCode = "TGO",- NumericIsoCode = 768,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Tokelau",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TK",- ThreeLetterIsoCode = "TKL",- NumericIsoCode = 772,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Tonga",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TO",- ThreeLetterIsoCode = "TON",- NumericIsoCode = 776,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Trinidad and Tobago",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TT",- ThreeLetterIsoCode = "TTO",- NumericIsoCode = 780,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Tunisia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TN",- ThreeLetterIsoCode = "TUN",- NumericIsoCode = 788,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Turkmenistan",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TM",- ThreeLetterIsoCode = "TKM",- NumericIsoCode = 795,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Turks and Caicos Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TC",- ThreeLetterIsoCode = "TCA",- NumericIsoCode = 796,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Tuvalu",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "TV",- ThreeLetterIsoCode = "TUV",- NumericIsoCode = 798,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Uganda",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "UG",- ThreeLetterIsoCode = "UGA",- NumericIsoCode = 800,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Vanuatu",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "VU",- ThreeLetterIsoCode = "VUT",- NumericIsoCode = 548,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Vatican City State (Holy See)",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "VA",- ThreeLetterIsoCode = "VAT",- NumericIsoCode = 336,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Viet Nam",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "VN",- ThreeLetterIsoCode = "VNM",- NumericIsoCode = 704,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Virgin Islands (British)",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "VG",- ThreeLetterIsoCode = "VGB",- NumericIsoCode = 92,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Virgin Islands (U.S.)",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "VI",- ThreeLetterIsoCode = "VIR",- NumericIsoCode = 850,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Wallis and Futuna Islands",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "WF",- ThreeLetterIsoCode = "WLF",- NumericIsoCode = 876,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Western Sahara",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "EH",- ThreeLetterIsoCode = "ESH",- NumericIsoCode = 732,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Yemen",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "YE",- ThreeLetterIsoCode = "YEM",- NumericIsoCode = 887,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Zambia",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ZM",- ThreeLetterIsoCode = "ZMB",- NumericIsoCode = 894,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- },- new Country- {- Name = "Zimbabwe",- AllowsBilling = true,- AllowsShipping = true,- TwoLetterIsoCode = "ZW",- ThreeLetterIsoCode = "ZWE",- NumericIsoCode = 716,- SubjectToVat = false,- DisplayOrder = 100,- Published = true- }- };- countries.ForEach(x=>_countryRepository.Insert(x));- }+ },+ new() {+ Name = "Gibraltar",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GI",+ ThreeLetterIsoCode = "GIB",+ NumericIsoCode = 292,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Greece",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GR",+ ThreeLetterIsoCode = "GRC",+ NumericIsoCode = 300,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Guatemala",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GT",+ ThreeLetterIsoCode = "GTM",+ NumericIsoCode = 320,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Hong Kong",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "HK",+ ThreeLetterIsoCode = "HKG",+ NumericIsoCode = 344,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Hungary",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "HU",+ ThreeLetterIsoCode = "HUN",+ NumericIsoCode = 348,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "India",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IN",+ ThreeLetterIsoCode = "IND",+ NumericIsoCode = 356,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Indonesia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ID",+ ThreeLetterIsoCode = "IDN",+ NumericIsoCode = 360,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Ireland",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IE",+ ThreeLetterIsoCode = "IRL",+ NumericIsoCode = 372,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Israel",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IL",+ ThreeLetterIsoCode = "ISR",+ NumericIsoCode = 376,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Italy",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IT",+ ThreeLetterIsoCode = "ITA",+ NumericIsoCode = 380,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Jamaica",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "JM",+ ThreeLetterIsoCode = "JAM",+ NumericIsoCode = 388,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Japan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "JP",+ ThreeLetterIsoCode = "JPN",+ NumericIsoCode = 392,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Jordan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "JO",+ ThreeLetterIsoCode = "JOR",+ NumericIsoCode = 400,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Kazakhstan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KZ",+ ThreeLetterIsoCode = "KAZ",+ NumericIsoCode = 398,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Korea, Democratic People's Republic of",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KP",+ ThreeLetterIsoCode = "PRK",+ NumericIsoCode = 408,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Kuwait",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KW",+ ThreeLetterIsoCode = "KWT",+ NumericIsoCode = 414,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Malaysia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MY",+ ThreeLetterIsoCode = "MYS",+ NumericIsoCode = 458,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Mexico",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MX",+ ThreeLetterIsoCode = "MEX",+ NumericIsoCode = 484,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Netherlands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NL",+ ThreeLetterIsoCode = "NLD",+ NumericIsoCode = 528,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "New Zealand",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NZ",+ ThreeLetterIsoCode = "NZL",+ NumericIsoCode = 554,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Norway",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NO",+ ThreeLetterIsoCode = "NOR",+ NumericIsoCode = 578,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Pakistan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PK",+ ThreeLetterIsoCode = "PAK",+ NumericIsoCode = 586,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Paraguay",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PY",+ ThreeLetterIsoCode = "PRY",+ NumericIsoCode = 600,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Peru",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PE",+ ThreeLetterIsoCode = "PER",+ NumericIsoCode = 604,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Philippines",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PH",+ ThreeLetterIsoCode = "PHL",+ NumericIsoCode = 608,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ cPoland,+ new() {+ Name = "Portugal",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PT",+ ThreeLetterIsoCode = "PRT",+ NumericIsoCode = 620,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Puerto Rico",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PR",+ ThreeLetterIsoCode = "PRI",+ NumericIsoCode = 630,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Qatar",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "QA",+ ThreeLetterIsoCode = "QAT",+ NumericIsoCode = 634,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Romania",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "RO",+ ThreeLetterIsoCode = "ROM",+ NumericIsoCode = 642,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Russia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "RU",+ ThreeLetterIsoCode = "RUS",+ NumericIsoCode = 643,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Saudi Arabia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SA",+ ThreeLetterIsoCode = "SAU",+ NumericIsoCode = 682,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Singapore",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SG",+ ThreeLetterIsoCode = "SGP",+ NumericIsoCode = 702,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Slovakia (Slovak Republic)",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SK",+ ThreeLetterIsoCode = "SVK",+ NumericIsoCode = 703,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Slovenia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SI",+ ThreeLetterIsoCode = "SVN",+ NumericIsoCode = 705,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "South Africa",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ZA",+ ThreeLetterIsoCode = "ZAF",+ NumericIsoCode = 710,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Spain",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ES",+ ThreeLetterIsoCode = "ESP",+ NumericIsoCode = 724,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Sweden",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SE",+ ThreeLetterIsoCode = "SWE",+ NumericIsoCode = 752,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Switzerland",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CH",+ ThreeLetterIsoCode = "CHE",+ NumericIsoCode = 756,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Taiwan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TW",+ ThreeLetterIsoCode = "TWN",+ NumericIsoCode = 158,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Thailand",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TH",+ ThreeLetterIsoCode = "THA",+ NumericIsoCode = 764,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Turkey",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TR",+ ThreeLetterIsoCode = "TUR",+ NumericIsoCode = 792,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Ukraine",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "UA",+ ThreeLetterIsoCode = "UKR",+ NumericIsoCode = 804,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "United Arab Emirates",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AE",+ ThreeLetterIsoCode = "ARE",+ NumericIsoCode = 784,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "United Kingdom",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GB",+ ThreeLetterIsoCode = "GBR",+ NumericIsoCode = 826,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "United States minor outlying islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "UM",+ ThreeLetterIsoCode = "UMI",+ NumericIsoCode = 581,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Uruguay",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "UY",+ ThreeLetterIsoCode = "URY",+ NumericIsoCode = 858,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Uzbekistan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "UZ",+ ThreeLetterIsoCode = "UZB",+ NumericIsoCode = 860,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Venezuela",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "VE",+ ThreeLetterIsoCode = "VEN",+ NumericIsoCode = 862,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Serbia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "RS",+ ThreeLetterIsoCode = "SRB",+ NumericIsoCode = 688,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Afghanistan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AF",+ ThreeLetterIsoCode = "AFG",+ NumericIsoCode = 4,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Albania",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AL",+ ThreeLetterIsoCode = "ALB",+ NumericIsoCode = 8,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Algeria",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "DZ",+ ThreeLetterIsoCode = "DZA",+ NumericIsoCode = 12,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "American Samoa",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AS",+ ThreeLetterIsoCode = "ASM",+ NumericIsoCode = 16,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Andorra",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AD",+ ThreeLetterIsoCode = "AND",+ NumericIsoCode = 20,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Angola",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AO",+ ThreeLetterIsoCode = "AGO",+ NumericIsoCode = 24,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Anguilla",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AI",+ ThreeLetterIsoCode = "AIA",+ NumericIsoCode = 660,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Antarctica",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AQ",+ ThreeLetterIsoCode = "ATA",+ NumericIsoCode = 10,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Antigua and Barbuda",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AG",+ ThreeLetterIsoCode = "ATG",+ NumericIsoCode = 28,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bahrain",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BH",+ ThreeLetterIsoCode = "BHR",+ NumericIsoCode = 48,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Barbados",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BB",+ ThreeLetterIsoCode = "BRB",+ NumericIsoCode = 52,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Benin",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BJ",+ ThreeLetterIsoCode = "BEN",+ NumericIsoCode = 204,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bhutan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BT",+ ThreeLetterIsoCode = "BTN",+ NumericIsoCode = 64,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Botswana",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BW",+ ThreeLetterIsoCode = "BWA",+ NumericIsoCode = 72,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Bouvet Island",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BV",+ ThreeLetterIsoCode = "BVT",+ NumericIsoCode = 74,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "British Indian Ocean Territory",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IO",+ ThreeLetterIsoCode = "IOT",+ NumericIsoCode = 86,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Brunei Darussalam",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BN",+ ThreeLetterIsoCode = "BRN",+ NumericIsoCode = 96,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Burkina Faso",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BF",+ ThreeLetterIsoCode = "BFA",+ NumericIsoCode = 854,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Burundi",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "BI",+ ThreeLetterIsoCode = "BDI",+ NumericIsoCode = 108,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cambodia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KH",+ ThreeLetterIsoCode = "KHM",+ NumericIsoCode = 116,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cameroon",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CM",+ ThreeLetterIsoCode = "CMR",+ NumericIsoCode = 120,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cape Verde",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CV",+ ThreeLetterIsoCode = "CPV",+ NumericIsoCode = 132,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Central African Republic",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CF",+ ThreeLetterIsoCode = "CAF",+ NumericIsoCode = 140,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Chad",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TD",+ ThreeLetterIsoCode = "TCD",+ NumericIsoCode = 148,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Christmas Island",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CX",+ ThreeLetterIsoCode = "CXR",+ NumericIsoCode = 162,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cocos (Keeling) Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CC",+ ThreeLetterIsoCode = "CCK",+ NumericIsoCode = 166,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Comoros",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KM",+ ThreeLetterIsoCode = "COM",+ NumericIsoCode = 174,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Congo",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CG",+ ThreeLetterIsoCode = "COG",+ NumericIsoCode = 178,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cook Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CK",+ ThreeLetterIsoCode = "COK",+ NumericIsoCode = 184,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Cote D'Ivoire",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "CI",+ ThreeLetterIsoCode = "CIV",+ NumericIsoCode = 384,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Djibouti",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "DJ",+ ThreeLetterIsoCode = "DJI",+ NumericIsoCode = 262,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Dominica",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "DM",+ ThreeLetterIsoCode = "DMA",+ NumericIsoCode = 212,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "El Salvador",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SV",+ ThreeLetterIsoCode = "SLV",+ NumericIsoCode = 222,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Equatorial Guinea",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GQ",+ ThreeLetterIsoCode = "GNQ",+ NumericIsoCode = 226,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Eritrea",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ER",+ ThreeLetterIsoCode = "ERI",+ NumericIsoCode = 232,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Estonia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "EE",+ ThreeLetterIsoCode = "EST",+ NumericIsoCode = 233,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Ethiopia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ET",+ ThreeLetterIsoCode = "ETH",+ NumericIsoCode = 231,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Falkland Islands (Malvinas)",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "FK",+ ThreeLetterIsoCode = "FLK",+ NumericIsoCode = 238,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Faroe Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "FO",+ ThreeLetterIsoCode = "FRO",+ NumericIsoCode = 234,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Fiji",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "FJ",+ ThreeLetterIsoCode = "FJI",+ NumericIsoCode = 242,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "French Guiana",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GF",+ ThreeLetterIsoCode = "GUF",+ NumericIsoCode = 254,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "French Polynesia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PF",+ ThreeLetterIsoCode = "PYF",+ NumericIsoCode = 258,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "French Southern Territories",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TF",+ ThreeLetterIsoCode = "ATF",+ NumericIsoCode = 260,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Gabon",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GA",+ ThreeLetterIsoCode = "GAB",+ NumericIsoCode = 266,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Gambia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GM",+ ThreeLetterIsoCode = "GMB",+ NumericIsoCode = 270,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Ghana",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GH",+ ThreeLetterIsoCode = "GHA",+ NumericIsoCode = 288,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Greenland",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GL",+ ThreeLetterIsoCode = "GRL",+ NumericIsoCode = 304,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Grenada",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GD",+ ThreeLetterIsoCode = "GRD",+ NumericIsoCode = 308,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Guadeloupe",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GP",+ ThreeLetterIsoCode = "GLP",+ NumericIsoCode = 312,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Guam",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GU",+ ThreeLetterIsoCode = "GUM",+ NumericIsoCode = 316,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Guinea",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GN",+ ThreeLetterIsoCode = "GIN",+ NumericIsoCode = 324,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Guinea-bissau",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GW",+ ThreeLetterIsoCode = "GNB",+ NumericIsoCode = 624,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Guyana",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GY",+ ThreeLetterIsoCode = "GUY",+ NumericIsoCode = 328,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Haiti",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "HT",+ ThreeLetterIsoCode = "HTI",+ NumericIsoCode = 332,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Heard and Mc Donald Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "HM",+ ThreeLetterIsoCode = "HMD",+ NumericIsoCode = 334,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Honduras",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "HN",+ ThreeLetterIsoCode = "HND",+ NumericIsoCode = 340,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Iceland",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IS",+ ThreeLetterIsoCode = "ISL",+ NumericIsoCode = 352,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Iran (Islamic Republic of)",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IR",+ ThreeLetterIsoCode = "IRN",+ NumericIsoCode = 364,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Iraq",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "IQ",+ ThreeLetterIsoCode = "IRQ",+ NumericIsoCode = 368,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Kenya",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KE",+ ThreeLetterIsoCode = "KEN",+ NumericIsoCode = 404,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Kiribati",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KI",+ ThreeLetterIsoCode = "KIR",+ NumericIsoCode = 296,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Korea",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KR",+ ThreeLetterIsoCode = "KOR",+ NumericIsoCode = 410,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Kyrgyzstan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KG",+ ThreeLetterIsoCode = "KGZ",+ NumericIsoCode = 417,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Lao People's Democratic Republic",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LA",+ ThreeLetterIsoCode = "LAO",+ NumericIsoCode = 418,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Latvia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LV",+ ThreeLetterIsoCode = "LVA",+ NumericIsoCode = 428,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Lebanon",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LB",+ ThreeLetterIsoCode = "LBN",+ NumericIsoCode = 422,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Lesotho",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LS",+ ThreeLetterIsoCode = "LSO",+ NumericIsoCode = 426,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Liberia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LR",+ ThreeLetterIsoCode = "LBR",+ NumericIsoCode = 430,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Libyan Arab Jamahiriya",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LY",+ ThreeLetterIsoCode = "LBY",+ NumericIsoCode = 434,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Liechtenstein",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LI",+ ThreeLetterIsoCode = "LIE",+ NumericIsoCode = 438,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Lithuania",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LT",+ ThreeLetterIsoCode = "LTU",+ NumericIsoCode = 440,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Luxembourg",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LU",+ ThreeLetterIsoCode = "LUX",+ NumericIsoCode = 442,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Macau",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MO",+ ThreeLetterIsoCode = "MAC",+ NumericIsoCode = 446,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Macedonia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MK",+ ThreeLetterIsoCode = "MKD",+ NumericIsoCode = 807,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Madagascar",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MG",+ ThreeLetterIsoCode = "MDG",+ NumericIsoCode = 450,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Malawi",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MW",+ ThreeLetterIsoCode = "MWI",+ NumericIsoCode = 454,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Maldives",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MV",+ ThreeLetterIsoCode = "MDV",+ NumericIsoCode = 462,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Mali",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ML",+ ThreeLetterIsoCode = "MLI",+ NumericIsoCode = 466,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Malta",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MT",+ ThreeLetterIsoCode = "MLT",+ NumericIsoCode = 470,+ SubjectToVat = true,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Marshall Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MH",+ ThreeLetterIsoCode = "MHL",+ NumericIsoCode = 584,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Martinique",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MQ",+ ThreeLetterIsoCode = "MTQ",+ NumericIsoCode = 474,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Mauritania",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MR",+ ThreeLetterIsoCode = "MRT",+ NumericIsoCode = 478,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Mauritius",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MU",+ ThreeLetterIsoCode = "MUS",+ NumericIsoCode = 480,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Mayotte",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "YT",+ ThreeLetterIsoCode = "MYT",+ NumericIsoCode = 175,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Micronesia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "FM",+ ThreeLetterIsoCode = "FSM",+ NumericIsoCode = 583,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Moldova",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MD",+ ThreeLetterIsoCode = "MDA",+ NumericIsoCode = 498,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Monaco",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MC",+ ThreeLetterIsoCode = "MCO",+ NumericIsoCode = 492,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Mongolia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MN",+ ThreeLetterIsoCode = "MNG",+ NumericIsoCode = 496,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Montenegro",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ME",+ ThreeLetterIsoCode = "MNE",+ NumericIsoCode = 499,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Montserrat",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MS",+ ThreeLetterIsoCode = "MSR",+ NumericIsoCode = 500,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Morocco",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MA",+ ThreeLetterIsoCode = "MAR",+ NumericIsoCode = 504,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Mozambique",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MZ",+ ThreeLetterIsoCode = "MOZ",+ NumericIsoCode = 508,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Myanmar",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MM",+ ThreeLetterIsoCode = "MMR",+ NumericIsoCode = 104,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Namibia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NA",+ ThreeLetterIsoCode = "NAM",+ NumericIsoCode = 516,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Nauru",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NR",+ ThreeLetterIsoCode = "NRU",+ NumericIsoCode = 520,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Nepal",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NP",+ ThreeLetterIsoCode = "NPL",+ NumericIsoCode = 524,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Netherlands Antilles",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "AN",+ ThreeLetterIsoCode = "ANT",+ NumericIsoCode = 530,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "New Caledonia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NC",+ ThreeLetterIsoCode = "NCL",+ NumericIsoCode = 540,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Nicaragua",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NI",+ ThreeLetterIsoCode = "NIC",+ NumericIsoCode = 558,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Niger",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NE",+ ThreeLetterIsoCode = "NER",+ NumericIsoCode = 562,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Nigeria",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NG",+ ThreeLetterIsoCode = "NGA",+ NumericIsoCode = 566,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Niue",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NU",+ ThreeLetterIsoCode = "NIU",+ NumericIsoCode = 570,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Norfolk Island",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "NF",+ ThreeLetterIsoCode = "NFK",+ NumericIsoCode = 574,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Northern Mariana Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "MP",+ ThreeLetterIsoCode = "MNP",+ NumericIsoCode = 580,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Oman",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "OM",+ ThreeLetterIsoCode = "OMN",+ NumericIsoCode = 512,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Palau",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PW",+ ThreeLetterIsoCode = "PLW",+ NumericIsoCode = 585,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Panama",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PA",+ ThreeLetterIsoCode = "PAN",+ NumericIsoCode = 591,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Papua New Guinea",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PG",+ ThreeLetterIsoCode = "PNG",+ NumericIsoCode = 598,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Pitcairn",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PN",+ ThreeLetterIsoCode = "PCN",+ NumericIsoCode = 612,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Reunion",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "RE",+ ThreeLetterIsoCode = "REU",+ NumericIsoCode = 638,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Rwanda",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "RW",+ ThreeLetterIsoCode = "RWA",+ NumericIsoCode = 646,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Saint Kitts and Nevis",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "KN",+ ThreeLetterIsoCode = "KNA",+ NumericIsoCode = 659,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Saint Lucia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LC",+ ThreeLetterIsoCode = "LCA",+ NumericIsoCode = 662,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Saint Vincent and the Grenadines",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "VC",+ ThreeLetterIsoCode = "VCT",+ NumericIsoCode = 670,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Samoa",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "WS",+ ThreeLetterIsoCode = "WSM",+ NumericIsoCode = 882,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "San Marino",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SM",+ ThreeLetterIsoCode = "SMR",+ NumericIsoCode = 674,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Sao Tome and Principe",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ST",+ ThreeLetterIsoCode = "STP",+ NumericIsoCode = 678,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Senegal",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SN",+ ThreeLetterIsoCode = "SEN",+ NumericIsoCode = 686,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Seychelles",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SC",+ ThreeLetterIsoCode = "SYC",+ NumericIsoCode = 690,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Sierra Leone",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SL",+ ThreeLetterIsoCode = "SLE",+ NumericIsoCode = 694,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Solomon Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SB",+ ThreeLetterIsoCode = "SLB",+ NumericIsoCode = 90,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Somalia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SO",+ ThreeLetterIsoCode = "SOM",+ NumericIsoCode = 706,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "South Georgia & South Sandwich Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "GS",+ ThreeLetterIsoCode = "SGS",+ NumericIsoCode = 239,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Sri Lanka",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "LK",+ ThreeLetterIsoCode = "LKA",+ NumericIsoCode = 144,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "St. Helena",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SH",+ ThreeLetterIsoCode = "SHN",+ NumericIsoCode = 654,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "St. Pierre and Miquelon",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "PM",+ ThreeLetterIsoCode = "SPM",+ NumericIsoCode = 666,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Sudan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SD",+ ThreeLetterIsoCode = "SDN",+ NumericIsoCode = 736,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Suriname",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SR",+ ThreeLetterIsoCode = "SUR",+ NumericIsoCode = 740,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Svalbard and Jan Mayen Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SJ",+ ThreeLetterIsoCode = "SJM",+ NumericIsoCode = 744,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Swaziland",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SZ",+ ThreeLetterIsoCode = "SWZ",+ NumericIsoCode = 748,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Syrian Arab Republic",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "SY",+ ThreeLetterIsoCode = "SYR",+ NumericIsoCode = 760,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Tajikistan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TJ",+ ThreeLetterIsoCode = "TJK",+ NumericIsoCode = 762,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Tanzania",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TZ",+ ThreeLetterIsoCode = "TZA",+ NumericIsoCode = 834,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Togo",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TG",+ ThreeLetterIsoCode = "TGO",+ NumericIsoCode = 768,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Tokelau",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TK",+ ThreeLetterIsoCode = "TKL",+ NumericIsoCode = 772,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Tonga",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TO",+ ThreeLetterIsoCode = "TON",+ NumericIsoCode = 776,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Trinidad and Tobago",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TT",+ ThreeLetterIsoCode = "TTO",+ NumericIsoCode = 780,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Tunisia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TN",+ ThreeLetterIsoCode = "TUN",+ NumericIsoCode = 788,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Turkmenistan",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TM",+ ThreeLetterIsoCode = "TKM",+ NumericIsoCode = 795,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Turks and Caicos Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TC",+ ThreeLetterIsoCode = "TCA",+ NumericIsoCode = 796,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Tuvalu",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "TV",+ ThreeLetterIsoCode = "TUV",+ NumericIsoCode = 798,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Uganda",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "UG",+ ThreeLetterIsoCode = "UGA",+ NumericIsoCode = 800,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Vanuatu",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "VU",+ ThreeLetterIsoCode = "VUT",+ NumericIsoCode = 548,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Vatican City State (Holy See)",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "VA",+ ThreeLetterIsoCode = "VAT",+ NumericIsoCode = 336,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Viet Nam",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "VN",+ ThreeLetterIsoCode = "VNM",+ NumericIsoCode = 704,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Virgin Islands (British)",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "VG",+ ThreeLetterIsoCode = "VGB",+ NumericIsoCode = 92,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Virgin Islands (U.S.)",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "VI",+ ThreeLetterIsoCode = "VIR",+ NumericIsoCode = 850,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Wallis and Futuna Islands",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "WF",+ ThreeLetterIsoCode = "WLF",+ NumericIsoCode = 876,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Western Sahara",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "EH",+ ThreeLetterIsoCode = "ESH",+ NumericIsoCode = 732,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Yemen",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "YE",+ ThreeLetterIsoCode = "YEM",+ NumericIsoCode = 887,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Zambia",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ZM",+ ThreeLetterIsoCode = "ZMB",+ NumericIsoCode = 894,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ },+ new() {+ Name = "Zimbabwe",+ AllowsBilling = true,+ AllowsShipping = true,+ TwoLetterIsoCode = "ZW",+ ThreeLetterIsoCode = "ZWE",+ NumericIsoCode = 716,+ SubjectToVat = false,+ DisplayOrder = 100,+ Published = true+ }+ };+ countries.ForEach(x => _countryRepository.Insert(x));}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCurrencies.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataCurrencies.csindex e1f0c3843..4d45b4d4c 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataCurrencies.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataCurrencies.cs@@ -1,94 +1,86 @@using Grand.Domain.Directory;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallCurrencies(){- protected virtual Task InstallCurrencies()- {- var currencies = new List<Currency>- {- new Currency- {- Name = "US Dollar",- CurrencyCode = "USD",- Rate = 1,- DisplayLocale = "en-US",- CustomFormatting = "",- NumberDecimal = 2,- Published = true,- DisplayOrder = 1,- RoundingTypeId = RoundingType.Rounding001,- MidpointRoundId = MidpointRounding.ToEven- },- new Currency- {- Name = "Euro",- CurrencyCode = "EUR",- Rate = 0.95,- DisplayLocale = "",- CustomFormatting = $"{"\u20ac"}0.00",- NumberDecimal = 2,- Published = true,- DisplayOrder = 2,- RoundingTypeId = RoundingType.Rounding001,- MidpointRoundId = MidpointRounding.AwayFromZero- },- new Currency- {- Name = "British Pound",- CurrencyCode = "GBP",- Rate = 0.82,- DisplayLocale = "en-GB",- CustomFormatting = "",- NumberDecimal = 2,- Published = false,- DisplayOrder = 3,- RoundingTypeId = RoundingType.Rounding001,- MidpointRoundId = MidpointRounding.AwayFromZero- },- new Currency- {- Name = "Chinese Yuan Renminbi",- CurrencyCode = "CNY",- Rate = 6.93,- DisplayLocale = "zh-CN",- CustomFormatting = "",- NumberDecimal = 2,- Published = false,- DisplayOrder = 4,- RoundingTypeId = RoundingType.Rounding001,- MidpointRoundId = MidpointRounding.ToEven- },- new Currency- {- Name = "Indian Rupee",- CurrencyCode = "INR",- Rate = 68.17,- DisplayLocale = "en-IN",- CustomFormatting = "",- NumberDecimal = 2,- Published = false,- DisplayOrder = 5,- RoundingTypeId = RoundingType.Rounding001,- MidpointRoundId = MidpointRounding.ToEven- },- new Currency- {- Name = "Złoty",- CurrencyCode = "PLN",- Rate = 3.97,- DisplayLocale = "pl-PL",- CustomFormatting = "",- NumberDecimal = 2,- Published = false,- DisplayOrder = 6,- RoundingTypeId = RoundingType.Rounding001,- MidpointRoundId = MidpointRounding.AwayFromZero- }- };- currencies.ForEach(x=>_currencyRepository.Insert(x));- return Task.CompletedTask;- }+ var currencies = new List<Currency> {+ new() {+ Name = "US Dollar",+ CurrencyCode = "USD",+ Rate = 1,+ DisplayLocale = "en-US",+ CustomFormatting = "",+ NumberDecimal = 2,+ Published = true,+ DisplayOrder = 1,+ RoundingTypeId = RoundingType.Rounding001,+ MidpointRoundId = MidpointRounding.ToEven+ },+ new() {+ Name = "Euro",+ CurrencyCode = "EUR",+ Rate = 0.95,+ DisplayLocale = "",+ CustomFormatting = $"{"\u20ac"}0.00",+ NumberDecimal = 2,+ Published = true,+ DisplayOrder = 2,+ RoundingTypeId = RoundingType.Rounding001,+ MidpointRoundId = MidpointRounding.AwayFromZero+ },+ new() {+ Name = "British Pound",+ CurrencyCode = "GBP",+ Rate = 0.82,+ DisplayLocale = "en-GB",+ CustomFormatting = "",+ NumberDecimal = 2,+ Published = false,+ DisplayOrder = 3,+ RoundingTypeId = RoundingType.Rounding001,+ MidpointRoundId = MidpointRounding.AwayFromZero+ },+ new() {+ Name = "Chinese Yuan Renminbi",+ CurrencyCode = "CNY",+ Rate = 6.93,+ DisplayLocale = "zh-CN",+ CustomFormatting = "",+ NumberDecimal = 2,+ Published = false,+ DisplayOrder = 4,+ RoundingTypeId = RoundingType.Rounding001,+ MidpointRoundId = MidpointRounding.ToEven+ },+ new() {+ Name = "Indian Rupee",+ CurrencyCode = "INR",+ Rate = 68.17,+ DisplayLocale = "en-IN",+ CustomFormatting = "",+ NumberDecimal = 2,+ Published = false,+ DisplayOrder = 5,+ RoundingTypeId = RoundingType.Rounding001,+ MidpointRoundId = MidpointRounding.ToEven+ },+ new() {+ Name = "Złoty",+ CurrencyCode = "PLN",+ Rate = 3.97,+ DisplayLocale = "pl-PL",+ CustomFormatting = "",+ NumberDecimal = 2,+ Published = false,+ DisplayOrder = 6,+ RoundingTypeId = RoundingType.Rounding001,+ MidpointRoundId = MidpointRounding.AwayFromZero+ }+ };+ currencies.ForEach(x => _currencyRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCustomersAndUsers.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataCustomersAndUsers.csindex 97753db68..2ad93a533 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataCustomersAndUsers.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataCustomersAndUsers.cs@@ -1,150 +1,139 @@using Grand.Domain.Common;using Grand.Domain.Customers;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallCustomersAndUsers(string defaultUserEmail, string defaultUserPassword){- protected virtual async Task InstallCustomersAndUsers(string defaultUserEmail, string defaultUserPassword)- {- var crAdministrators = new CustomerGroup- {- Name = "Administrators",- Active = true,- IsSystem = true,- SystemName = SystemCustomerGroupNames.Administrators- };- await _customerGroupRepository.InsertAsync(crAdministrators);-- var crRegistered = new CustomerGroup- {- Name = "Registered",- Active = true,- IsSystem = true,- SystemName = SystemCustomerGroupNames.Registered- };- await _customerGroupRepository.InsertAsync(crRegistered);+ var crAdministrators = new CustomerGroup {+ Name = "Administrators",+ Active = true,+ IsSystem = true,+ SystemName = SystemCustomerGroupNames.Administrators+ };+ await _customerGroupRepository.InsertAsync(crAdministrators);- var crGuests = new CustomerGroup- {- Name = "Guests",- Active = true,- IsSystem = true,- SystemName = SystemCustomerGroupNames.Guests- };- await _customerGroupRepository.InsertAsync(crGuests);+ var crRegistered = new CustomerGroup {+ Name = "Registered",+ Active = true,+ IsSystem = true,+ SystemName = SystemCustomerGroupNames.Registered+ };+ await _customerGroupRepository.InsertAsync(crRegistered);- var crVendors = new CustomerGroup- {- Name = "Vendors",- Active = true,- IsSystem = true,- SystemName = SystemCustomerGroupNames.Vendors- };- await _customerGroupRepository.InsertAsync(crVendors);+ var crGuests = new CustomerGroup {+ Name = "Guests",+ Active = true,+ IsSystem = true,+ SystemName = SystemCustomerGroupNames.Guests+ };+ await _customerGroupRepository.InsertAsync(crGuests);- var crStaff = new CustomerGroup- {- Name = "Staff",- Active = true,- IsSystem = true,- SystemName = SystemCustomerGroupNames.Staff- };- await _customerGroupRepository.InsertAsync(crStaff);+ var crVendors = new CustomerGroup {+ Name = "Vendors",+ Active = true,+ IsSystem = true,+ SystemName = SystemCustomerGroupNames.Vendors+ };+ await _customerGroupRepository.InsertAsync(crVendors);- var crSalesManager = new CustomerGroup- {- Name = "Sales manager",- Active = true,- IsSystem = true,- SystemName = SystemCustomerGroupNames.SalesManager- };- await _customerGroupRepository.InsertAsync(crSalesManager);+ var crStaff = new CustomerGroup {+ Name = "Staff",+ Active = true,+ IsSystem = true,+ SystemName = SystemCustomerGroupNames.Staff+ };+ await _customerGroupRepository.InsertAsync(crStaff);- //admin user- var adminUser = new Customer- {- CustomerGuid = Guid.NewGuid(),- Email = defaultUserEmail,- Username = defaultUserEmail,- Password = defaultUserPassword,- PasswordFormatId = PasswordFormat.Clear,- PasswordSalt = "",- Active = true,- LastActivityDateUtc = DateTime.UtcNow,- PasswordChangeDateUtc = DateTime.UtcNow- };- var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");- var defaultAdminUserAddress = new Address- {- FirstName = "John",- LastName = "Smith",- PhoneNumber = "12345678",- Email = "[email protected]",- FaxNumber = "",- Company = "GrandNode LTD",- Address1 = "21 West 52nd Street",- Address2 = "",- City = "New York",- StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,- CountryId = country?.Id,- ZipPostalCode = "10021"- };- adminUser.Addresses.Add(defaultAdminUserAddress);- adminUser.BillingAddress = defaultAdminUserAddress;- adminUser.ShippingAddress = defaultAdminUserAddress;- adminUser.Groups.Add(crAdministrators.Id);- adminUser.Groups.Add(crRegistered.Id);- adminUser.UserFields.Add(new UserField { Key = SystemCustomerFieldNames.FirstName, Value = "John", StoreId = "" });- adminUser.UserFields.Add(new UserField { Key = SystemCustomerFieldNames.LastName, Value = "Smith", StoreId = "" });- await _customerRepository.InsertAsync(adminUser);+ var crSalesManager = new CustomerGroup {+ Name = "Sales manager",+ Active = true,+ IsSystem = true,+ SystemName = SystemCustomerGroupNames.SalesManager+ };+ await _customerGroupRepository.InsertAsync(crSalesManager);- //Anonymous user- var anonymousUser = new Customer- {- Email = "[email protected]",- CustomerGuid = Guid.NewGuid(),- PasswordFormatId = PasswordFormat.Clear,- AdminComment = "Built-in system guest record used for anonymous requests.",- Active = true,- IsSystemAccount = true,- SystemName = SystemCustomerNames.Anonymous,- LastActivityDateUtc = DateTime.UtcNow- };- anonymousUser.Groups.Add(crGuests.Id);- await _customerRepository.InsertAsync(anonymousUser);+ //admin user+ var adminUser = new Customer {+ CustomerGuid = Guid.NewGuid(),+ Email = defaultUserEmail,+ Username = defaultUserEmail,+ Password = defaultUserPassword,+ PasswordFormatId = PasswordFormat.Clear,+ PasswordSalt = "",+ Active = true,+ LastActivityDateUtc = DateTime.UtcNow,+ PasswordChangeDateUtc = DateTime.UtcNow+ };+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");+ var defaultAdminUserAddress = new Address {+ FirstName = "John",+ LastName = "Smith",+ PhoneNumber = "12345678",+ Email = "[email protected]",+ FaxNumber = "",+ Company = "GrandNode LTD",+ Address1 = "21 West 52nd Street",+ Address2 = "",+ City = "New York",+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,+ CountryId = country?.Id,+ ZipPostalCode = "10021"+ };+ adminUser.Addresses.Add(defaultAdminUserAddress);+ adminUser.BillingAddress = defaultAdminUserAddress;+ adminUser.ShippingAddress = defaultAdminUserAddress;+ adminUser.Groups.Add(crAdministrators.Id);+ adminUser.Groups.Add(crRegistered.Id);+ adminUser.UserFields.Add(new UserField+ { Key = SystemCustomerFieldNames.FirstName, Value = "John", StoreId = "" });+ adminUser.UserFields.Add(new UserField+ { Key = SystemCustomerFieldNames.LastName, Value = "Smith", StoreId = "" });+ await _customerRepository.InsertAsync(adminUser);- //search engine (crawler) built-in user- var searchEngineUser = new Customer- {- Email = "builtin@search_engine_record.com",- CustomerGuid = Guid.NewGuid(),- PasswordFormatId = PasswordFormat.Clear,- AdminComment = "Built-in system guest record used for requests from search engines.",- Active = true,- IsSystemAccount = true,- SystemName = SystemCustomerNames.SearchEngine,- LastActivityDateUtc = DateTime.UtcNow- };- searchEngineUser.Groups.Add(crGuests.Id);- await _customerRepository.InsertAsync(searchEngineUser);+ //Anonymous user+ var anonymousUser = new Customer {+ Email = "[email protected]",+ CustomerGuid = Guid.NewGuid(),+ PasswordFormatId = PasswordFormat.Clear,+ AdminComment = "Built-in system guest record used for anonymous requests.",+ Active = true,+ IsSystemAccount = true,+ SystemName = SystemCustomerNames.Anonymous,+ LastActivityDateUtc = DateTime.UtcNow+ };+ anonymousUser.Groups.Add(crGuests.Id);+ await _customerRepository.InsertAsync(anonymousUser);+ //search engine (crawler) built-in user+ var searchEngineUser = new Customer {+ Email = "builtin@search_engine_record.com",+ CustomerGuid = Guid.NewGuid(),+ PasswordFormatId = PasswordFormat.Clear,+ AdminComment = "Built-in system guest record used for requests from search engines.",+ Active = true,+ IsSystemAccount = true,+ SystemName = SystemCustomerNames.SearchEngine,+ LastActivityDateUtc = DateTime.UtcNow+ };+ searchEngineUser.Groups.Add(crGuests.Id);+ await _customerRepository.InsertAsync(searchEngineUser);- //built-in user for background tasks- var backgroundTaskUser = new Customer- {- Email = "[email protected]",- CustomerGuid = Guid.NewGuid(),- PasswordFormatId = PasswordFormat.Clear,- AdminComment = "Built-in system record used for background tasks.",- Active = true,- IsSystemAccount = true,- SystemName = SystemCustomerNames.BackgroundTask,- LastActivityDateUtc = DateTime.UtcNow- };- backgroundTaskUser.Groups.Add(crGuests.Id);- await _customerRepository.InsertAsync(backgroundTaskUser);- }+ //built-in user for background tasks+ var backgroundTaskUser = new Customer {+ Email = "[email protected]",+ CustomerGuid = Guid.NewGuid(),+ PasswordFormatId = PasswordFormat.Clear,+ AdminComment = "Built-in system record used for background tasks.",+ Active = true,+ IsSystemAccount = true,+ SystemName = SystemCustomerNames.BackgroundTask,+ LastActivityDateUtc = DateTime.UtcNow+ };+ backgroundTaskUser.Groups.Add(crGuests.Id);+ await _customerRepository.InsertAsync(backgroundTaskUser);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataDeliveryDates.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataDeliveryDates.csindex 9551df816..3d240fbb2 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataDeliveryDates.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataDeliveryDates.cs@@ -1,31 +1,26 @@using Grand.Domain.Shipping;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallDeliveryDates(){- protected virtual Task InstallDeliveryDates()- {- var deliveryDates = new List<DeliveryDate>- {- new DeliveryDate- {- Name = "1-2 days",- DisplayOrder = 1- },- new DeliveryDate- {- Name = "3-5 days",- DisplayOrder = 5- },- new DeliveryDate- {- Name = "1 week",- DisplayOrder = 10- }- };- deliveryDates.ForEach(x=>_deliveryDateRepository.Insert(x));- return Task.CompletedTask;- }+ var deliveryDates = new List<DeliveryDate> {+ new() {+ Name = "1-2 days",+ DisplayOrder = 1+ },+ new() {+ Name = "3-5 days",+ DisplayOrder = 5+ },+ new() {+ Name = "1 week",+ DisplayOrder = 10+ }+ };+ deliveryDates.ForEach(x => _deliveryDateRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataDiscounts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataDiscounts.csindex 34b4de515..b1ee973ac 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataDiscounts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataDiscounts.cs@@ -1,53 +1,49 @@using Grand.Domain.Discounts;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallDiscounts(){- protected virtual async Task InstallDiscounts()- {- var discounts = new List<Discount>- {- new Discount- {- Name = "Sample discount with coupon code",- DiscountTypeId = DiscountType.AssignedToOrderTotal,- DiscountLimitationId = DiscountLimitationType.Nolimits,- UsePercentage = false,- DiscountAmount = 10,- RequiresCouponCode = true,- IsEnabled = true,- CurrencyCode = "USD"- },- new Discount- {- Name = "'20% order total' discount",- DiscountTypeId = DiscountType.AssignedToOrderTotal,- DiscountLimitationId = DiscountLimitationType.Nolimits,- UsePercentage = true,- DiscountPercentage = 20,- StartDateUtc = new DateTime(2010,1,1),- EndDateUtc = new DateTime(2030,1,1),- RequiresCouponCode = true,- IsEnabled = true,- CurrencyCode = "USD"- }- };- discounts.ForEach(x=>_discountRepository.Insert(x));+ var discounts = new List<Discount> {+ new() {+ Name = "Sample discount with coupon code",+ DiscountTypeId = DiscountType.AssignedToOrderTotal,+ DiscountLimitationId = DiscountLimitationType.Nolimits,+ UsePercentage = false,+ DiscountAmount = 10,+ RequiresCouponCode = true,+ IsEnabled = true,+ CurrencyCode = "USD"+ },+ new() {+ Name = "'20% order total' discount",+ DiscountTypeId = DiscountType.AssignedToOrderTotal,+ DiscountLimitationId = DiscountLimitationType.Nolimits,+ UsePercentage = true,+ DiscountPercentage = 20,+ StartDateUtc = new DateTime(2010, 1, 1),+ EndDateUtc = new DateTime(2030, 1, 1),+ RequiresCouponCode = true,+ IsEnabled = true,+ CurrencyCode = "USD"+ }+ };+ discounts.ForEach(x => _discountRepository.Insert(x));- var coupon1 = new DiscountCoupon- {- CouponCode = "123",- DiscountId = _discountRepository.Table.Where(x => x.Name == "Sample discount with coupon code").FirstOrDefault()!.Id- };- await _discountCouponRepository.InsertAsync(coupon1);+ var coupon1 = new DiscountCoupon {+ CouponCode = "123",+ DiscountId = _discountRepository.Table.Where(x => x.Name == "Sample discount with coupon code")+ .FirstOrDefault()!.Id+ };+ await _discountCouponRepository.InsertAsync(coupon1);- var coupon2 = new DiscountCoupon- {- CouponCode = "456",- DiscountId = _discountRepository.Table.Where(x => x.Name == "'20% order total' discount").FirstOrDefault()!.Id- };- await _discountCouponRepository.InsertAsync(coupon2);- }+ var coupon2 = new DiscountCoupon {+ CouponCode = "456",+ DiscountId = _discountRepository.Table.Where(x => x.Name == "'20% order total' discount").FirstOrDefault()!+ .Id+ };+ await _discountCouponRepository.InsertAsync(coupon2);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataEmailAccounts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataEmailAccounts.csindex 1b6f718fd..776a5323b 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataEmailAccounts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataEmailAccounts.cs@@ -1,27 +1,24 @@using Grand.Domain.Messages;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallEmailAccounts(){- protected virtual Task InstallEmailAccounts()- {- var emailAccounts = new List<EmailAccount>- {- new EmailAccount- {- Email = "[email protected]",- DisplayName = "Store name",- Host = "smtp.mail.com",- Port = 25,- Username = "123",- Password = "123",- SecureSocketOptionsId = 1,- UseServerCertificateValidation = true- }- };- emailAccounts.ForEach(x=>_emailAccountRepository.Insert(x));- return Task.CompletedTask;- }+ var emailAccounts = new List<EmailAccount> {+ new() {+ Email = "[email protected]",+ DisplayName = "Store name",+ Host = "smtp.mail.com",+ Port = 25,+ Username = "123",+ Password = "123",+ SecureSocketOptionsId = 1,+ UseServerCertificateValidation = true+ }+ };+ emailAccounts.ForEach(x => _emailAccountRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataLanguages.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataLanguages.csindex 794a89976..332e13d8b 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataLanguages.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataLanguages.cs@@ -1,21 +1,19 @@using Grand.Domain.Localization;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallLanguages(){- protected virtual async Task InstallLanguages()- {- var language = new Language- {- Name = "English",- LanguageCulture = "en-US",- UniqueSeoCode = "en",- FlagImageFileName = "us.png",- Published = true,- DisplayOrder = 1- };- await _languageRepository.InsertAsync(language);- }+ var language = new Language {+ Name = "English",+ LanguageCulture = "en-US",+ UniqueSeoCode = "en",+ FlagImageFileName = "us.png",+ Published = true,+ DisplayOrder = 1+ };+ await _languageRepository.InsertAsync(language);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataLocaleResources.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataLocaleResources.csindex 6e5c6f29f..7c830fc1e 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataLocaleResources.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataLocaleResources.cs@@ -2,20 +2,19 @@using Grand.SharedKernel.Extensions;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallLocaleResources(){- protected virtual async Task InstallLocaleResources()- {- //'English' language- var language = _languageRepository.Table.Single(l => l.Name == "English");+ //'English' language+ var language = _languageRepository.Table.Single(l => l.Name == "English");- //save resources- var filePath = CommonPath.MapPath("App_Data/Resources/DefaultLanguage.xml");- var localesXml = File.ReadAllText(filePath);- var translationService = _serviceProvider.GetRequiredService<ITranslationService>();- await translationService.ImportResourcesFromXmlInstall(language, localesXml);- }+ //save resources+ var filePath = CommonPath.MapPath("App_Data/Resources/DefaultLanguage.xml");+ var localesXml = File.ReadAllText(filePath);+ var translationService = _serviceProvider.GetRequiredService<ITranslationService>();+ await translationService.ImportResourcesFromXmlInstall(language, localesXml);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMeasures.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataMeasures.csindex e786a53ba..1b24303c3 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataMeasures.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataMeasures.cs@@ -1,92 +1,78 @@using Grand.Domain.Directory;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallMeasures(){- protected virtual Task InstallMeasures()- {- var measureDimensions = new List<MeasureDimension>- {- new MeasureDimension- {- Name = "centimetre(s)",- SystemKeyword = "centimetres",- Ratio = 1,- DisplayOrder = 1- },- new MeasureDimension- {- Name = "inch(es)",- SystemKeyword = "inches",- Ratio = 0.393701,- DisplayOrder = 2- },- new MeasureDimension- {- Name = "feet",- SystemKeyword = "feet",- Ratio = 0.0328084,- DisplayOrder = 3- }- };+ var measureDimensions = new List<MeasureDimension> {+ new() {+ Name = "centimetre(s)",+ SystemKeyword = "centimetres",+ Ratio = 1,+ DisplayOrder = 1+ },+ new() {+ Name = "inch(es)",+ SystemKeyword = "inches",+ Ratio = 0.393701,+ DisplayOrder = 2+ },+ new() {+ Name = "feet",+ SystemKeyword = "feet",+ Ratio = 0.0328084,+ DisplayOrder = 3+ }+ };- measureDimensions.ForEach(x=>_measureDimensionRepository.Insert(x));+ measureDimensions.ForEach(x => _measureDimensionRepository.Insert(x));- var measureWeights = new List<MeasureWeight>- {- new MeasureWeight- {- Name = "ounce(s)",- SystemKeyword = "ounce",- Ratio = 16,- DisplayOrder = 1- },- new MeasureWeight- {- Name = "lb(s)",- SystemKeyword = "lb",- Ratio = 1,- DisplayOrder = 2- },- new MeasureWeight- {- Name = "kg(s)",- SystemKeyword = "kg",- Ratio = 0.45359237,- DisplayOrder = 3- },- new MeasureWeight- {- Name = "gram(s)",- SystemKeyword = "grams",- Ratio = 453.59237,- DisplayOrder = 4- }- };+ var measureWeights = new List<MeasureWeight> {+ new() {+ Name = "ounce(s)",+ SystemKeyword = "ounce",+ Ratio = 16,+ DisplayOrder = 1+ },+ new() {+ Name = "lb(s)",+ SystemKeyword = "lb",+ Ratio = 1,+ DisplayOrder = 2+ },+ new() {+ Name = "kg(s)",+ SystemKeyword = "kg",+ Ratio = 0.45359237,+ DisplayOrder = 3+ },+ new() {+ Name = "gram(s)",+ SystemKeyword = "grams",+ Ratio = 453.59237,+ DisplayOrder = 4+ }+ };- measureWeights.ForEach(x=>_measureWeightRepository.Insert(x));+ measureWeights.ForEach(x => _measureWeightRepository.Insert(x));- var measureUnits = new List<MeasureUnit>- {- new MeasureUnit- {- Name = "pcs.",- DisplayOrder = 1- },- new MeasureUnit- {- Name = "pair",- DisplayOrder = 2- },- new MeasureUnit- {- Name = "set",- DisplayOrder = 3- }- };- measureUnits.ForEach(x=>_measureUnitRepository.Insert(x));- return Task.CompletedTask;- }+ var measureUnits = new List<MeasureUnit> {+ new() {+ Name = "pcs.",+ DisplayOrder = 1+ },+ new() {+ Name = "pair",+ DisplayOrder = 2+ },+ new() {+ Name = "set",+ DisplayOrder = 3+ }+ };+ measureUnits.ForEach(x => _measureUnitRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnActions.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnActions.csindex c41da4292..ad8ebe3e6 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnActions.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnActions.cs@@ -1,32 +1,26 @@using Grand.Domain.Orders;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallMerchandiseReturnActions(){- protected virtual Task InstallMerchandiseReturnActions()- {- var merchandiseReturnActions = new List<MerchandiseReturnAction>- {- new MerchandiseReturnAction- {- Name = "Repair",- DisplayOrder = 1- },- new MerchandiseReturnAction- {- Name = "Replacement",- DisplayOrder = 2- },- new MerchandiseReturnAction- {- Name = "Store Credit",- DisplayOrder = 3- }- };- merchandiseReturnActions.ForEach(x=>_merchandiseReturnActionRepository.Insert(x));- return Task.CompletedTask;- }-+ var merchandiseReturnActions = new List<MerchandiseReturnAction> {+ new() {+ Name = "Repair",+ DisplayOrder = 1+ },+ new() {+ Name = "Replacement",+ DisplayOrder = 2+ },+ new() {+ Name = "Store Credit",+ DisplayOrder = 3+ }+ };+ merchandiseReturnActions.ForEach(x => _merchandiseReturnActionRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnReasons.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnReasons.csindex f00d6a12e..6f6c23872 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnReasons.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnReasons.cs@@ -1,32 +1,27 @@using Grand.Domain.Orders;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallMerchandiseReturnReasons(){- protected virtual Task InstallMerchandiseReturnReasons()- {- var merchandiseReturnReasons = new List<MerchandiseReturnReason>- {- new MerchandiseReturnReason- {- Name = "Received Wrong Product",- DisplayOrder = 1- },- new MerchandiseReturnReason- {- Name = "Wrong Product Ordered",- DisplayOrder = 2- },- new MerchandiseReturnReason- {- Name = "There Was A Problem With The Product",- DisplayOrder = 3- }- };+ var merchandiseReturnReasons = new List<MerchandiseReturnReason> {+ new() {+ Name = "Received Wrong Product",+ DisplayOrder = 1+ },+ new() {+ Name = "Wrong Product Ordered",+ DisplayOrder = 2+ },+ new() {+ Name = "There Was A Problem With The Product",+ DisplayOrder = 3+ }+ };- merchandiseReturnReasons.ForEach(x=>_merchandiseReturnReasonRepository.Insert(x));- return Task.CompletedTask;- }+ merchandiseReturnReasons.ForEach(x => _merchandiseReturnReasonRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMessageTemplates.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataMessageTemplates.csindex 5ea85b7c2..61a1b0964 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataMessageTemplates.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataMessageTemplates.cs@@ -1,16 +1,16 @@using Grand.Domain.Messages;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallMessageTemplates(){- protected virtual Task InstallMessageTemplates()- {- var eaGeneral = _emailAccountRepository.Table.FirstOrDefault();- if (eaGeneral == null)- throw new Exception("Default email account cannot be loaded");+ var eaGeneral = _emailAccountRepository.Table.FirstOrDefault();+ if (eaGeneral == null)+ throw new Exception("Default email account cannot be loaded");- var OrderProducts = @"+ var OrderProducts = @"<table style='width: 100%;' border='0'><tr style='background-color: #b9babe; text-align: center;'><th>Name</th><th>Price</th><th>Quantity</th><th>Total</th></tr>{% for item in Order.OrderItems -%}@@ -88,7 +88,7 @@ namespace Grand.Business.System.Services.Installation<tr style='text-align:right;'><td> </td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Order Total:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.Total}}</strong></td></tr></table>";- var OrderVendorProducts = @"+ var OrderVendorProducts = @"<table style='width: 100%;' border='0'><tr style='background-color: #b9babe; text-align: center;'><th>Name</th><th>Price</th><th>Quantity</th><th>Total</th></tr>{% for item in Order.OrderItems -%}@@ -129,7 +129,7 @@ namespace Grand.Business.System.Services.Installation</table>";- var ShipmentProducts = @"+ var ShipmentProducts = @"<table border='0' style='width:100%;'><tr style='background-color:#b9babe; text-align:center;'><th>Name</th>@@ -156,427 +156,435 @@ namespace Grand.Business.System.Services.Installation</table>";- var messageTemplates = new List<MessageTemplate>- {- new MessageTemplate- {- Name = "AuctionEnded.CustomerNotificationWin",- Subject = "{{Store.Name}}. Auction ended.",- Body = "<p>Hello, {{Customer.FullName}}!</p><p></p><p>At {{Auctions.EndTime}} you have won <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> for {{Auctions.Price}}. Visit <a href=\"{{Store.URL}}/cart\">cart</a> to finish checkout process. </p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "AuctionEnded.CustomerNotificationLost",- Subject = "{{Store.Name}}. Auction ended.",- Body = "<p>Hello, {{Customer.FullName}}!</p><p></p><p>Unfortunately you did not win the bid {{Auctions.ProductName}}</p> <p>End price: {{Auctions.Price}} </p> <p>End date auction {{Auctions.EndTime}} </p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "AuctionEnded.CustomerNotificationBin",- Subject = "{{Store.Name}}. Auction ended.",- Body = "<p>Hello, {{Customer.FullName}}!</p><p></p><p>Unfortunately you did not win the bid {{Product.Name}}</p> <p>Product was bought by option Buy it now for price: {{Product.Price}} </p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "AuctionEnded.StoreOwnerNotification",- Subject = "{{Store.Name}}. Auction ended.",- Body = "<p>At {{Auctions.EndTime}} {{Customer.FullName}} have won <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> for {{Auctions.Price}}.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "AuctionExpired.StoreOwnerNotification",- Subject = "Your auction to product {{Product.Name}} has expired.",- Body = "Hello, <br> Your auction to product {{Product.Name}} has expired without bid.",- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "BidUp.CustomerNotification",- Subject = "{{Store.Name}}. Your offer has been outbid.",- Body = "<p>Hi {{Customer.FullName}}!</p><p>Your offer for product <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> has been outbid. Your price was {{Auctions.Price}}.<br />\r\nRaise a price by raising one's offer. Auction will be ended on {{Auctions.EndTime}}</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Blog.BlogComment",- Subject = "{{Store.Name}}. New blog comment.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new blog comment has been created for blog post \"{{BlogComment.BlogPostTitle}}\".</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Knowledgebase.ArticleComment",- Subject = "{{Store.Name}}. New article comment.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new article comment has been created for article \"{{Knowledgebase.ArticleCommentTitle}}\".</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.OutOfStock",- Subject = "{{Store.Name}}. Back in stock notification",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}, <br />\r\nProduct <a target=\"_blank\" href=\"{{OutOfStockSubscription.ProductUrl}}\">{{OutOfStockSubscription.ProductName}}</a> is in stock.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "CustomerDelete.StoreOwnerNotification",- Subject = "{{Store.Name}}. Customer has been deleted.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> ,<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just deleted from your database. </p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.EmailTokenValidationMessage",- Subject = "{{Store.Name}} - Email Verification Code",- Body = "Hello {{Customer.FullName}}, <br /><br />\r\n Enter this 6 digit code on the sign in page to confirm your identity:<br /><br /> \r\n <b>{{Customer.Token}}</b><br /><br />\r\n Yours securely, <br /> \r\n Team",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.EmailValidationMessage",- Subject = "{{Store.Name}}. Email validation",- Body = "<a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n <br />\r\n To activate your account <a href=\"{{Customer.AccountActivationURL}}\">click here</a>. <br />\r\n <br />\r\n {{Store.Name}}",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.NewPM",- Subject = "{{Store.Name}}. You have received a new private message",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nYou have received a new private message.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.PasswordRecovery",- Subject = "{{Store.Name}}. Password recovery",- Body = "<a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n <br />\r\n To change your password <a href=\"{{Customer.PasswordRecoveryURL}}\">click here</a>. <br />\r\n <br />\r\n {{Store.Name}}",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.WelcomeMessage",- Subject = "Welcome to {{Store.Name}}",- Body = "We welcome you to <a href=\"{{Store.URL}}\"> {{Store.Name}}</a>.<br />\r\n<br />\r\nYou can now take part in the various services we have to offer you. Some of these services include:<br />\r\n<br />\r\nPermanent Cart - Any products added to your online cart remain there until you remove them, or check them out.<br />\r\nAddress Book - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.<br />\r\nOrder History - View your history of purchases that you have made with us.<br />\r\nProducts Reviews - Share your opinions on products with our other customers.<br />\r\n<br />\r\nFor help with any of our online services, please email the store-owner: <a href=\"mailto:{{Store.Email}}\">{{Store.Email}}</a>.<br />\r\n<br />\r\nNote: This email address was provided on our registration page. If you own the email and did not register on our site, please send an email to <a href=\"mailto:{{Store.Email}}\">{{Store.Email}}</a>.",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "GiftVoucher.Notification",- Subject = "{{GiftVoucher.SenderName}} has sent you a gift voucher for {{Store.Name}}",- Body = "<p>You have received a gift voucher for {{Store.Name}}</p><p>Dear {{GiftVoucher.RecipientName}}, <br />\r\n<br />\r\n{{GiftVoucher.SenderName}} ({{GiftVoucher.SenderEmail}}) has sent you a {{GiftVoucher.Amount}} gift cart for <a href=\"{{Store.URL}}\"> {{Store.Name}}</a></p><p>You gift voucher code is {{GiftVoucher.CouponCode}}</p><p>{{GiftVoucher.Message}}</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "NewCustomer.Notification",- Subject = "{{Store.Name}}. New customer registration",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new customer registered with your store. Below are the customer's details:<br />\r\nFull name: {{Customer.FullName}}<br />\r\nEmail: {{Customer.Email}}</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "NewMerchandiseReturn.CustomerNotification",- Subject = "{{Store.Name}}. New merchandise return.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}!<br />\r\n You have just submitted a new merchandise return. Details are below:<br />\r\nRequest ID: {{MerchandiseReturn.ReturnNumber}}<br />\r\nCustomer comments: {{MerchandiseReturn.CustomerComment}}<br />\r\n<br />\r\nPickup date: {{MerchandiseReturn.PickupDate}}<br />\r\n<br />\r\nPickup address:<br />\r\n{{MerchandiseReturn.PickupAddressFirstName}} {{MerchandiseReturn.PickupAddressLastName}}<br />\r\n{{MerchandiseReturn.PickupAddressAddress1}}<br />\r\n{{MerchandiseReturn.PickupAddressCity}} {{MerchandiseReturn.PickupAddressZipPostalCode}}<br />\r\n{{MerchandiseReturn.PickupAddressStateProvince}} {{MerchandiseReturn.PickupAddressCountry}}<br />\r\n</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "NewMerchandiseReturn.StoreOwnerNotification",- Subject = "{{Store.Name}}. New merchandise return.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} has just submitted a new merchandise return. Details are below:<br />\r\nRequest ID: {{MerchandiseReturn.ReturnNumber}}<br />\r\nCustomer comments: {{MerchandiseReturn.CustomerComment}}<br />\r\n<br />\r\nPickup date: {{MerchandiseReturn.PickupDate}}<br />\r\n<br />\r\nPickup address:<br />\r\n{{MerchandiseReturn.PickupAddressFirstName}} {{MerchandiseReturn.PickupAddressLastName}}<br />\r\n{{MerchandiseReturn.PickupAddressAddress1}}<br />\r\n{{MerchandiseReturn.PickupAddressCity}} {{MerchandiseReturn.PickupAddressZipPostalCode}}<br />\r\n{{MerchandiseReturn.PickupAddressStateProvince}} {{MerchandiseReturn.PickupAddressCountry}}<br />\r\n</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "News.NewsComment",- Subject = "{{Store.Name}}. New news comment.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new news comment has been created for news \"{{NewsComment.NewsTitle}}\".</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "NewsLetterSubscription.ActivationMessage",- Subject = "{{Store.Name}}. Subscription activation message.",- Body = "<p><a href=\"{{NewsLetterSubscription.ActivationUrl}}\">Click here to confirm your subscription to our list.</a></p><p>If you received this email by mistake, simply delete it.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "NewsLetterSubscription.DeactivationMessage",- Subject = "{{Store.Name}}. Subscription deactivation message.",- Body = "<p><a href=\"{{NewsLetterSubscription.DeactivationUrl}}\">Click here to unsubscribe from our newsletter.</a></p><p>If you received this email by mistake, simply delete it.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderCancelled.StoreOwnerNotification",- Subject = "{{Store.Name}}. Customer cancelled an order",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n<br />\r\nCustomer cancelled an order. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" + OrderProducts + "</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderCancelled.CustomerNotification",- Subject = "{{Store.Name}}. Your order cancelled",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nYour order has been cancelled. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" + OrderProducts + "</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderCancelled.VendorNotification",- Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} cancelled",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br /><br />Order #{{Order.OrderNumber}} has been cancelled. <br /><br />Order Number: {{Order.OrderNumber}} <br /> Date Ordered: {{Order.CreatedOn}} <br /><br /> ",- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderCompleted.CustomerNotification",- Subject = "{{Store.Name}}. Your order completed",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nYour order has been completed. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" + OrderProducts + "</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "ShipmentDelivered.CustomerNotification",- Subject = "Your order from {{Store.Name}} has been delivered.",- Body = "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n <br />\r\n Hello {{Order.CustomerFullName}}, <br />\r\n Good news! You order has been delivered. <br />\r\n Order Number: {{Order.OrderNumber}}<br />\r\n Order Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\n Date Ordered: {{Order.CreatedOn}}<br />\r\n <br />\r\n <br />\r\n <br />\r\n Billing Address<br />\r\n {{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n {{Order.BillingAddress1}}<br />\r\n {{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n {{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n <br />\r\n <br />\r\n <br />\r\n Shipping Address<br />\r\n {{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n {{Order.ShippingAddress1}}<br />\r\n {{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n {{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n <br />\r\n Shipping Method: {{Order.ShippingMethod}} <br />\r\n <br />\r\n Delivered Products: <br />\r\n <br />\r\n" + ShipmentProducts + "</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderPlaced.CustomerNotification",- Subject = "Order receipt from {{Store.Name}}.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" + OrderProducts + "</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderPlaced.StoreOwnerNotification",- Subject = "{{Store.Name}}. Purchase Receipt for Order #{{Order.OrderNumber}}",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Order.CustomerFullName}} ({{Order.CustomerEmail}}) has just placed an order from your store. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" + OrderProducts + "</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "ShipmentSent.CustomerNotification",- Subject = "Your order from {{Store.Name}} has been shipped.",- Body = "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}!, <br />\r\nGood news! You order has been shipped. <br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}} <br />\r\n <br />\r\n Shipped Products: <br />\r\n <br />\r\n" + ShipmentProducts + "</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Product.ProductReview",- Subject = "{{Store.Name}}. New product review.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new product review has been written for product \"{{ProductReview.ProductName}}\".</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "QuantityBelow.StoreOwnerNotification",- Subject = "{{Store.Name}}. Quantity below notification. {{Product.Name}}",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Product.Name}} (ID: {{Product.Id}}) low quantity. <br />\r\n<br />\r\nQuantity: {{Product.StockQuantity}}<br />\r\n</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "QuantityBelow.AttributeCombination.StoreOwnerNotification",- Subject = "{{Store.Name}}. Quantity below notification. {{Product.Name}}",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Product.Name}} (ID: {{Product.Id}}) low quantity. <br />\r\n{{AttributeCombination.Formatted}}<br />\r\nQuantity: {{AttributeCombination.StockQuantity}}<br />\r\n</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "MerchandiseReturnStatusChanged.CustomerNotification",- Subject = "{{Store.Name}}. Merchandise return status was changed.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}},<br />\r\nYour merchandise return #{{MerchandiseReturn.ReturnNumber}} status has been changed.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Service.EmailAFriend",- Subject = "{{Store.Name}}. Referred Item",- Body = "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{EmailAFriend.Email}} was shopping on {{Store.Name}} and wanted to share the following item with you. <br />\r\n<br />\r\n<b><a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">{{Product.Name}}</a></b> <br />\r\n{{Product.ShortDescription}} <br />\r\n<br />\r\nFor more info click <a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">here</a> <br />\r\n<br />\r\n<br />\r\n{{EmailAFriend.PersonalMessage}}<br />\r\n<br />\r\n{{Store.Name}}</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Service.AskQuestion",- Subject = "{{Store.Name}}. Question about a product",- Body = "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{AskQuestion.Email}} wanted to ask question about a product {{Product.Name}}. <br />\r\n<br />\r\n<b><a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">{{Product.Name}}</a></b> <br />\r\n{{Product.ShortDescription}} <br />\r\n{{AskQuestion.Message}}<br />\r\n {{AskQuestion.Email}} <br />\r\n {{AskQuestion.FullName}} <br />\r\n {{AskQuestion.Phone}} <br />\r\n{{Store.Name}}</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Service.ContactUs",- Subject = "{{Store.Name}}. Contact us",- Body = "<p>From {{ContactUs.SenderName}} - {{ContactUs.SenderEmail}}<br /><br />{{ContactUs.Body}}<br />{{ContactUs.AttributeDescription}}</p><br />",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Service.ContactVendor",- Subject = "{{Store.Name}}. Contact us",- Body = "<p>From {{ContactUs.SenderName}} - {{ContactUs.SenderEmail}}<br /><br />{{ContactUs.Body}}</p><br />",- IsActive = true,- EmailAccountId = eaGeneral.Id- },+ var messageTemplates = new List<MessageTemplate> {+ new() {+ Name = "AuctionEnded.CustomerNotificationWin",+ Subject = "{{Store.Name}}. Auction ended.",+ Body =+ "<p>Hello, {{Customer.FullName}}!</p><p></p><p>At {{Auctions.EndTime}} you have won <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> for {{Auctions.Price}}. Visit <a href=\"{{Store.URL}}/cart\">cart</a> to finish checkout process. </p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "AuctionEnded.CustomerNotificationLost",+ Subject = "{{Store.Name}}. Auction ended.",+ Body =+ "<p>Hello, {{Customer.FullName}}!</p><p></p><p>Unfortunately you did not win the bid {{Auctions.ProductName}}</p> <p>End price: {{Auctions.Price}} </p> <p>End date auction {{Auctions.EndTime}} </p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "AuctionEnded.CustomerNotificationBin",+ Subject = "{{Store.Name}}. Auction ended.",+ Body =+ "<p>Hello, {{Customer.FullName}}!</p><p></p><p>Unfortunately you did not win the bid {{Product.Name}}</p> <p>Product was bought by option Buy it now for price: {{Product.Price}} </p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "AuctionEnded.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Auction ended.",+ Body =+ "<p>At {{Auctions.EndTime}} {{Customer.FullName}} have won <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> for {{Auctions.Price}}.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "AuctionExpired.StoreOwnerNotification",+ Subject = "Your auction to product {{Product.Name}} has expired.",+ Body = "Hello, <br> Your auction to product {{Product.Name}} has expired without bid.",+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "BidUp.CustomerNotification",+ Subject = "{{Store.Name}}. Your offer has been outbid.",+ Body =+ "<p>Hi {{Customer.FullName}}!</p><p>Your offer for product <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> has been outbid. Your price was {{Auctions.Price}}.<br />\r\nRaise a price by raising one's offer. Auction will be ended on {{Auctions.EndTime}}</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Blog.BlogComment",+ Subject = "{{Store.Name}}. New blog comment.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new blog comment has been created for blog post \"{{BlogComment.BlogPostTitle}}\".</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Knowledgebase.ArticleComment",+ Subject = "{{Store.Name}}. New article comment.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new article comment has been created for article \"{{Knowledgebase.ArticleCommentTitle}}\".</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.OutOfStock",+ Subject = "{{Store.Name}}. Back in stock notification",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}, <br />\r\nProduct <a target=\"_blank\" href=\"{{OutOfStockSubscription.ProductUrl}}\">{{OutOfStockSubscription.ProductName}}</a> is in stock.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "CustomerDelete.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Customer has been deleted.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> ,<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just deleted from your database. </p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.EmailTokenValidationMessage",+ Subject = "{{Store.Name}} - Email Verification Code",+ Body =+ "Hello {{Customer.FullName}}, <br /><br />\r\n Enter this 6 digit code on the sign in page to confirm your identity:<br /><br /> \r\n <b>{{Customer.Token}}</b><br /><br />\r\n Yours securely, <br /> \r\n Team",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.EmailValidationMessage",+ Subject = "{{Store.Name}}. Email validation",+ Body =+ "<a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n <br />\r\n To activate your account <a href=\"{{Customer.AccountActivationURL}}\">click here</a>. <br />\r\n <br />\r\n {{Store.Name}}",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.NewPM",+ Subject = "{{Store.Name}}. You have received a new private message",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nYou have received a new private message.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.PasswordRecovery",+ Subject = "{{Store.Name}}. Password recovery",+ Body =+ "<a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n <br />\r\n To change your password <a href=\"{{Customer.PasswordRecoveryURL}}\">click here</a>. <br />\r\n <br />\r\n {{Store.Name}}",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.WelcomeMessage",+ Subject = "Welcome to {{Store.Name}}",+ Body =+ "We welcome you to <a href=\"{{Store.URL}}\"> {{Store.Name}}</a>.<br />\r\n<br />\r\nYou can now take part in the various services we have to offer you. Some of these services include:<br />\r\n<br />\r\nPermanent Cart - Any products added to your online cart remain there until you remove them, or check them out.<br />\r\nAddress Book - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.<br />\r\nOrder History - View your history of purchases that you have made with us.<br />\r\nProducts Reviews - Share your opinions on products with our other customers.<br />\r\n<br />\r\nFor help with any of our online services, please email the store-owner: <a href=\"mailto:{{Store.Email}}\">{{Store.Email}}</a>.<br />\r\n<br />\r\nNote: This email address was provided on our registration page. If you own the email and did not register on our site, please send an email to <a href=\"mailto:{{Store.Email}}\">{{Store.Email}}</a>.",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "GiftVoucher.Notification",+ Subject = "{{GiftVoucher.SenderName}} has sent you a gift voucher for {{Store.Name}}",+ Body =+ "<p>You have received a gift voucher for {{Store.Name}}</p><p>Dear {{GiftVoucher.RecipientName}}, <br />\r\n<br />\r\n{{GiftVoucher.SenderName}} ({{GiftVoucher.SenderEmail}}) has sent you a {{GiftVoucher.Amount}} gift cart for <a href=\"{{Store.URL}}\"> {{Store.Name}}</a></p><p>You gift voucher code is {{GiftVoucher.CouponCode}}</p><p>{{GiftVoucher.Message}}</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "NewCustomer.Notification",+ Subject = "{{Store.Name}}. New customer registration",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new customer registered with your store. Below are the customer's details:<br />\r\nFull name: {{Customer.FullName}}<br />\r\nEmail: {{Customer.Email}}</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "NewMerchandiseReturn.CustomerNotification",+ Subject = "{{Store.Name}}. New merchandise return.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}!<br />\r\n You have just submitted a new merchandise return. Details are below:<br />\r\nRequest ID: {{MerchandiseReturn.ReturnNumber}}<br />\r\nCustomer comments: {{MerchandiseReturn.CustomerComment}}<br />\r\n<br />\r\nPickup date: {{MerchandiseReturn.PickupDate}}<br />\r\n<br />\r\nPickup address:<br />\r\n{{MerchandiseReturn.PickupAddressFirstName}} {{MerchandiseReturn.PickupAddressLastName}}<br />\r\n{{MerchandiseReturn.PickupAddressAddress1}}<br />\r\n{{MerchandiseReturn.PickupAddressCity}} {{MerchandiseReturn.PickupAddressZipPostalCode}}<br />\r\n{{MerchandiseReturn.PickupAddressStateProvince}} {{MerchandiseReturn.PickupAddressCountry}}<br />\r\n</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "NewMerchandiseReturn.StoreOwnerNotification",+ Subject = "{{Store.Name}}. New merchandise return.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} has just submitted a new merchandise return. Details are below:<br />\r\nRequest ID: {{MerchandiseReturn.ReturnNumber}}<br />\r\nCustomer comments: {{MerchandiseReturn.CustomerComment}}<br />\r\n<br />\r\nPickup date: {{MerchandiseReturn.PickupDate}}<br />\r\n<br />\r\nPickup address:<br />\r\n{{MerchandiseReturn.PickupAddressFirstName}} {{MerchandiseReturn.PickupAddressLastName}}<br />\r\n{{MerchandiseReturn.PickupAddressAddress1}}<br />\r\n{{MerchandiseReturn.PickupAddressCity}} {{MerchandiseReturn.PickupAddressZipPostalCode}}<br />\r\n{{MerchandiseReturn.PickupAddressStateProvince}} {{MerchandiseReturn.PickupAddressCountry}}<br />\r\n</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "News.NewsComment",+ Subject = "{{Store.Name}}. New news comment.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new news comment has been created for news \"{{NewsComment.NewsTitle}}\".</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "NewsLetterSubscription.ActivationMessage",+ Subject = "{{Store.Name}}. Subscription activation message.",+ Body =+ "<p><a href=\"{{NewsLetterSubscription.ActivationUrl}}\">Click here to confirm your subscription to our list.</a></p><p>If you received this email by mistake, simply delete it.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "NewsLetterSubscription.DeactivationMessage",+ Subject = "{{Store.Name}}. Subscription deactivation message.",+ Body =+ "<p><a href=\"{{NewsLetterSubscription.DeactivationUrl}}\">Click here to unsubscribe from our newsletter.</a></p><p>If you received this email by mistake, simply delete it.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderCancelled.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Customer cancelled an order",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n<br />\r\nCustomer cancelled an order. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" ++ OrderProducts + "</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderCancelled.CustomerNotification",+ Subject = "{{Store.Name}}. Your order cancelled",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nYour order has been cancelled. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" ++ OrderProducts + "</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderCancelled.VendorNotification",+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} cancelled",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br /><br />Order #{{Order.OrderNumber}} has been cancelled. <br /><br />Order Number: {{Order.OrderNumber}} <br /> Date Ordered: {{Order.CreatedOn}} <br /><br /> ",+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderCompleted.CustomerNotification",+ Subject = "{{Store.Name}}. Your order completed",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nYour order has been completed. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" ++ OrderProducts + "</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "ShipmentDelivered.CustomerNotification",+ Subject = "Your order from {{Store.Name}} has been delivered.",+ Body =+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n <br />\r\n Hello {{Order.CustomerFullName}}, <br />\r\n Good news! You order has been delivered. <br />\r\n Order Number: {{Order.OrderNumber}}<br />\r\n Order Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\n Date Ordered: {{Order.CreatedOn}}<br />\r\n <br />\r\n <br />\r\n <br />\r\n Billing Address<br />\r\n {{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n {{Order.BillingAddress1}}<br />\r\n {{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n {{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n <br />\r\n <br />\r\n <br />\r\n Shipping Address<br />\r\n {{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n {{Order.ShippingAddress1}}<br />\r\n {{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n {{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n <br />\r\n Shipping Method: {{Order.ShippingMethod}} <br />\r\n <br />\r\n Delivered Products: <br />\r\n <br />\r\n" ++ ShipmentProducts + "</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderPlaced.CustomerNotification",+ Subject = "Order receipt from {{Store.Name}}.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" ++ OrderProducts + "</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderPlaced.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Purchase Receipt for Order #{{Order.OrderNumber}}",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Order.CustomerFullName}} ({{Order.CustomerEmail}}) has just placed an order from your store. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" ++ OrderProducts + "</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "ShipmentSent.CustomerNotification",+ Subject = "Your order from {{Store.Name}} has been shipped.",+ Body =+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}!, <br />\r\nGood news! You order has been shipped. <br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}} <br />\r\n <br />\r\n Shipped Products: <br />\r\n <br />\r\n" ++ ShipmentProducts + "</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Product.ProductReview",+ Subject = "{{Store.Name}}. New product review.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new product review has been written for product \"{{ProductReview.ProductName}}\".</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "QuantityBelow.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Quantity below notification. {{Product.Name}}",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Product.Name}} (ID: {{Product.Id}}) low quantity. <br />\r\n<br />\r\nQuantity: {{Product.StockQuantity}}<br />\r\n</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "QuantityBelow.AttributeCombination.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Quantity below notification. {{Product.Name}}",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Product.Name}} (ID: {{Product.Id}}) low quantity. <br />\r\n{{AttributeCombination.Formatted}}<br />\r\nQuantity: {{AttributeCombination.StockQuantity}}<br />\r\n</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "MerchandiseReturnStatusChanged.CustomerNotification",+ Subject = "{{Store.Name}}. Merchandise return status was changed.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}},<br />\r\nYour merchandise return #{{MerchandiseReturn.ReturnNumber}} status has been changed.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Service.EmailAFriend",+ Subject = "{{Store.Name}}. Referred Item",+ Body =+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{EmailAFriend.Email}} was shopping on {{Store.Name}} and wanted to share the following item with you. <br />\r\n<br />\r\n<b><a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">{{Product.Name}}</a></b> <br />\r\n{{Product.ShortDescription}} <br />\r\n<br />\r\nFor more info click <a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">here</a> <br />\r\n<br />\r\n<br />\r\n{{EmailAFriend.PersonalMessage}}<br />\r\n<br />\r\n{{Store.Name}}</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Service.AskQuestion",+ Subject = "{{Store.Name}}. Question about a product",+ Body =+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{AskQuestion.Email}} wanted to ask question about a product {{Product.Name}}. <br />\r\n<br />\r\n<b><a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">{{Product.Name}}</a></b> <br />\r\n{{Product.ShortDescription}} <br />\r\n{{AskQuestion.Message}}<br />\r\n {{AskQuestion.Email}} <br />\r\n {{AskQuestion.FullName}} <br />\r\n {{AskQuestion.Phone}} <br />\r\n{{Store.Name}}</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Service.ContactUs",+ Subject = "{{Store.Name}}. Contact us",+ Body =+ "<p>From {{ContactUs.SenderName}} - {{ContactUs.SenderEmail}}<br /><br />{{ContactUs.Body}}<br />{{ContactUs.AttributeDescription}}</p><br />",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Service.ContactVendor",+ Subject = "{{Store.Name}}. Contact us",+ Body =+ "<p>From {{ContactUs.SenderName}} - {{ContactUs.SenderEmail}}<br /><br />{{ContactUs.Body}}</p><br />",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },++ new() {+ Name = "Wishlist.EmailAFriend",+ Subject = "{{Store.Name}}. Wishlist",+ Body =+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{EmailAFriend.Email}} was shopping on {{Store.Name}} and wanted to share a wishlist with you <br />\r\n<br />\r\n<br />\r\nFor more info click <a target=\"_blank\" href=\"{{Customer.WishlistURLForCustomer}}\">here</a> <br />\r\n<br />\r\n<br />\r\n{{EmailAFriend.PersonalMessage}}<br />\r\n<br />\r\n{{Store.Name}}</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.NewOrderNote",+ Subject = "{{Store.Name}}. New order note has been added",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}, <br />\r\nNew order note has been added to your account:<br />\r\n\"{{Order.NewNoteText}}\".<br />\r\n<a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a></p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.NewCustomerNote",+ Subject = "New customer note has been added",+ Body =+ "<p><br />\r\nHello {{Customer.FullName}}, <br />\r\nNew customer note has been added to your account:<br />\r\n\"{{Customer.NewTitleText}}\".<br />\r\n</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Customer.NewMerchandiseReturnNote",+ Subject = "{{Store.Name}}. New merchandise return note has been added",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}},<br />\r\nYour merchandise return #{{MerchandiseReturn.ReturnNumber}} has a new note.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderPlaced.VendorNotification",+ Subject = "{{Store.Name}}. Order placed",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just placed an order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n" ++ OrderVendorProducts + "</p>",+ //this template is disabled by default+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderPaid.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just paid<br />\r\nDate Ordered: {{Order.CreatedOn}}</p>",+ //this template is disabled by default+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderPaid.CustomerNotification",+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Order #{{Order.OrderNumber}} has been just paid. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" ++ OrderProducts + "</p>",+ //this template is disabled by default+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderPaid.VendorNotification",+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just paid. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n" ++ OrderVendorProducts + "</p>",+ //this template is disabled by default+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderRefunded.CustomerNotification",+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} refunded",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Order #{{Order.OrderNumber}} has been has been refunded. Please allow 7-14 days for the refund to be reflected in your account.<br />\r\n<br />\r\nAmount refunded: {{Order.AmountRefunded}}<br />\r\n<br />\r\nBelow is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" ++ OrderProducts + "</p>",+ //this template is disabled by default+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "OrderRefunded.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} refunded",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just refunded<br />\r\n<br />\r\nAmount refunded: {{Order.AmountRefunded}}<br />\r\n<br />\r\nDate Ordered: {{Order.CreatedOn}}</p>",+ //this template is disabled by default+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "VendorAccountApply.StoreOwnerNotification",+ Subject = "{{Store.Name}}. New vendor account submitted.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just submitted for a vendor account. Details are below:<br />\r\nVendor name: {{Vendor.Name}}<br />\r\nVendor email: {{Vendor.Email}}<br />\r\n<br />\r\nYou can activate it in admin area.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "Vendor.VendorReview",+ Subject = "{{Store.Name}}. New vendor review.",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new vendor review has been written.</p>",+ IsActive = true,+ EmailAccountId = eaGeneral.Id+ },+ new() {+ Name = "VendorInformationChange.StoreOwnerNotification",+ Subject = "{{Store.Name}}. Vendor {{Vendor.Name}} changed provided information",+ Body =+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Vendor.Name}} changed provided information.</p>",+ IsActive = false,+ EmailAccountId = eaGeneral.Id+ }+ };- new MessageTemplate- {- Name = "Wishlist.EmailAFriend",- Subject = "{{Store.Name}}. Wishlist",- Body = "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{EmailAFriend.Email}} was shopping on {{Store.Name}} and wanted to share a wishlist with you <br />\r\n<br />\r\n<br />\r\nFor more info click <a target=\"_blank\" href=\"{{Customer.WishlistURLForCustomer}}\">here</a> <br />\r\n<br />\r\n<br />\r\n{{EmailAFriend.PersonalMessage}}<br />\r\n<br />\r\n{{Store.Name}}</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.NewOrderNote",- Subject = "{{Store.Name}}. New order note has been added",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}, <br />\r\nNew order note has been added to your account:<br />\r\n\"{{Order.NewNoteText}}\".<br />\r\n<a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a></p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.NewCustomerNote",- Subject = "New customer note has been added",- Body = "<p><br />\r\nHello {{Customer.FullName}}, <br />\r\nNew customer note has been added to your account:<br />\r\n\"{{Customer.NewTitleText}}\".<br />\r\n</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Customer.NewMerchandiseReturnNote",- Subject = "{{Store.Name}}. New merchandise return note has been added",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}},<br />\r\nYour merchandise return #{{MerchandiseReturn.ReturnNumber}} has a new note.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderPlaced.VendorNotification",- Subject = "{{Store.Name}}. Order placed",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just placed an order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n" + OrderVendorProducts + "</p>",- //this template is disabled by default- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderPaid.StoreOwnerNotification",- Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just paid<br />\r\nDate Ordered: {{Order.CreatedOn}}</p>",- //this template is disabled by default- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderPaid.CustomerNotification",- Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Order #{{Order.OrderNumber}} has been just paid. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" + OrderProducts + "</p>",- //this template is disabled by default- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderPaid.VendorNotification",- Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just paid. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n" + OrderVendorProducts + "</p>",- //this template is disabled by default- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderRefunded.CustomerNotification",- Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} refunded",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Order #{{Order.OrderNumber}} has been has been refunded. Please allow 7-14 days for the refund to be reflected in your account.<br />\r\n<br />\r\nAmount refunded: {{Order.AmountRefunded}}<br />\r\n<br />\r\nBelow is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" + OrderProducts + "</p>",- //this template is disabled by default- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "OrderRefunded.StoreOwnerNotification",- Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} refunded",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just refunded<br />\r\n<br />\r\nAmount refunded: {{Order.AmountRefunded}}<br />\r\n<br />\r\nDate Ordered: {{Order.CreatedOn}}</p>",- //this template is disabled by default- IsActive = false,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "VendorAccountApply.StoreOwnerNotification",- Subject = "{{Store.Name}}. New vendor account submitted.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just submitted for a vendor account. Details are below:<br />\r\nVendor name: {{Vendor.Name}}<br />\r\nVendor email: {{Vendor.Email}}<br />\r\n<br />\r\nYou can activate it in admin area.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "Vendor.VendorReview",- Subject = "{{Store.Name}}. New vendor review.",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new vendor review has been written.</p>",- IsActive = true,- EmailAccountId = eaGeneral.Id- },- new MessageTemplate- {- Name = "VendorInformationChange.StoreOwnerNotification",- Subject = "{{Store.Name}}. Vendor {{Vendor.Name}} changed provided information",- Body = "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Vendor.Name}} changed provided information.</p>",- IsActive = false,- EmailAccountId = eaGeneral.Id- }- };-- messageTemplates.ForEach(x=>_messageTemplateRepository.Insert(x));- return Task.CompletedTask;- }+ messageTemplates.ForEach(x => _messageTemplateRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataNews.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataNews.csindex b70ec103e..f4b8e5f81 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataNews.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataNews.cs@@ -2,58 +2,56 @@using Grand.Domain.News;using Grand.Domain.Seo;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallNews(){- protected virtual async Task InstallNews()- {- var defaultLanguage = _languageRepository.Table.FirstOrDefault();- var news = new List<NewsItem>- {- new NewsItem- {- AllowComments = false,- Title = "About Grandnode",- Short = "It's stable and highly usable. From downloads to documentation, www.grandnode.com offers a comprehensive base of information, resources, and support to the grandnode community.",- Full = "<p>For full feature list go to <a href=\"https://grandnode.com\">grandnode.com</a></p><p>Providing outstanding custom search engine optimization, web development services and e-commerce development solutions to our clients at a fair price in a professional manner.</p>",- Published = true,- },- new NewsItem- {- AllowComments = false,- Title = "Grandnode new release!",- Short = "grandnode includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included! grandnode is a fully customizable shopping cart",- Full = "<p>Grandnode includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included!</p>",- Published = true,- },- new NewsItem- {- AllowComments = false,- Title = "New online store is open!",- Short = "The new grandnode store is open now! We are very excited to offer our new range of products. We will be constantly adding to our range so please register on our site.",- Full = "<p>Our online store is officially up and running. Stock up for the holiday season! We have a great selection of items. We will be constantly adding to our range so please register on our site, this will enable you to keep up to date with any new products.</p><p>All shipping is worldwide and will leave the same day an order is placed! Happy Shopping and spread the word!!</p>",- Published = true,- }-- };- news.ForEach(x=>_newsItemRepository.Insert(x));-- //search engine names- foreach (var newsItem in news)- {- newsItem.SeName = SeoExtensions.GenerateSlug(newsItem.Title, false, false, false);- await _entityUrlRepository.InsertAsync(new EntityUrl- {- EntityId = newsItem.Id,- EntityName = "NewsItem",- LanguageId = "",- IsActive = true,- Slug = newsItem.SeName- });- await _newsItemRepository.UpdateAsync(newsItem);+ var defaultLanguage = _languageRepository.Table.FirstOrDefault();+ var news = new List<NewsItem> {+ new() {+ AllowComments = false,+ Title = "About Grandnode",+ Short =+ "It's stable and highly usable. From downloads to documentation, www.grandnode.com offers a comprehensive base of information, resources, and support to the grandnode community.",+ Full =+ "<p>For full feature list go to <a href=\"https://grandnode.com\">grandnode.com</a></p><p>Providing outstanding custom search engine optimization, web development services and e-commerce development solutions to our clients at a fair price in a professional manner.</p>",+ Published = true+ },+ new() {+ AllowComments = false,+ Title = "Grandnode new release!",+ Short =+ "grandnode includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included! grandnode is a fully customizable shopping cart",+ Full =+ "<p>Grandnode includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included!</p>",+ Published = true+ },+ new() {+ AllowComments = false,+ Title = "New online store is open!",+ Short =+ "The new grandnode store is open now! We are very excited to offer our new range of products. We will be constantly adding to our range so please register on our site.",+ Full =+ "<p>Our online store is officially up and running. Stock up for the holiday season! We have a great selection of items. We will be constantly adding to our range so please register on our site, this will enable you to keep up to date with any new products.</p><p>All shipping is worldwide and will leave the same day an order is placed! Happy Shopping and spread the word!!</p>",+ Published = true}+ };+ news.ForEach(x => _newsItemRepository.Insert(x));+ //search engine names+ foreach (var newsItem in news)+ {+ newsItem.SeName = SeoExtensions.GenerateSlug(newsItem.Title, false, false, false);+ await _entityUrlRepository.InsertAsync(new EntityUrl {+ EntityId = newsItem.Id,+ EntityName = "NewsItem",+ LanguageId = "",+ IsActive = true,+ Slug = newsItem.SeName+ });+ await _newsItemRepository.UpdateAsync(newsItem);}}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderStatus.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderStatus.csindex 26f78886e..0952f9e67 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderStatus.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderStatus.cs@@ -1,44 +1,38 @@using Grand.Domain.Orders;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallOrderStatus(){- protected virtual Task InstallOrderStatus()- {- var statuses = new List<OrderStatus>- {- new OrderStatus- {- IsSystem = true,- StatusId = 10,- Name = "Pending",- DisplayOrder = 0- },- new OrderStatus- {- IsSystem = true,- StatusId = 20,- Name = "Processing",- DisplayOrder = 1- },- new OrderStatus- {- IsSystem = true,- StatusId = 30,- Name = "Complete",- DisplayOrder = 2- },- new OrderStatus- {- IsSystem = true,- StatusId = 40,- Name = "Cancelled",- DisplayOrder = 3- }- };- statuses.ForEach(x=> _orderStatusRepository.Insert(x));- return Task.CompletedTask;- }+ var statuses = new List<OrderStatus> {+ new() {+ IsSystem = true,+ StatusId = 10,+ Name = "Pending",+ DisplayOrder = 0+ },+ new() {+ IsSystem = true,+ StatusId = 20,+ Name = "Processing",+ DisplayOrder = 1+ },+ new() {+ IsSystem = true,+ StatusId = 30,+ Name = "Complete",+ DisplayOrder = 2+ },+ new() {+ IsSystem = true,+ StatusId = 40,+ Name = "Cancelled",+ DisplayOrder = 3+ }+ };+ statuses.ForEach(x => _orderStatusRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderTags.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderTags.csindex 01d758ec0..40d38f7de 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderTags.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderTags.cs@@ -1,35 +1,27 @@using Grand.Domain.Orders;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallOrderTags(){- protected virtual async Task InstallOrderTags()- {- var coolTag = new OrderTag- {- Name = "cool",- Count = 0-- };- await _orderTagRepository.InsertAsync(coolTag);-- var newTag = new OrderTag- {- Name = "new",- Count = 0-- };- await _orderTagRepository.InsertAsync(newTag);-- var oldTag = new OrderTag- {- Name = "old",- Count = 0+ var coolTag = new OrderTag {+ Name = "cool",+ Count = 0+ };+ await _orderTagRepository.InsertAsync(coolTag);- };- await _orderTagRepository.InsertAsync(oldTag);+ var newTag = new OrderTag {+ Name = "new",+ Count = 0+ };+ await _orderTagRepository.InsertAsync(newTag);- }+ var oldTag = new OrderTag {+ Name = "old",+ Count = 0+ };+ await _orderTagRepository.InsertAsync(oldTag);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataPageLayouts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataPageLayouts.csindex f06b68305..d385ee82f 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataPageLayouts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataPageLayouts.cs@@ -1,22 +1,19 @@using Grand.Domain.Pages;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallPageLayouts(){- protected virtual Task InstallPageLayouts()- {- var pageLayouts = new List<PageLayout>- {- new PageLayout- {- Name = "Default layout",- ViewPath = "PageDetails",- DisplayOrder = 1- }- };- pageLayouts.ForEach(x=>_pageLayoutRepository.Insert(x));- return Task.CompletedTask;- }+ var pageLayouts = new List<PageLayout> {+ new() {+ Name = "Default layout",+ ViewPath = "PageDetails",+ DisplayOrder = 1+ }+ };+ pageLayouts.ForEach(x => _pageLayoutRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataPages.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataPages.csindex 8de41f61b..b40e03f12 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataPages.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataPages.cs@@ -1,199 +1,185 @@using Grand.Domain.Pages;using Grand.Domain.Seo;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallPages(){- protected virtual async Task InstallPages()- {- var defaultPageLayout =- _pageLayoutRepository.Table.FirstOrDefault(tt => tt.Name == "Default layout");- if (defaultPageLayout == null)- throw new Exception("Page layout cannot be loaded");-- var pages = new List<Page>- {- new Page- {- SystemName = "AboutUs",- IncludeInSitemap = false,- IsPasswordProtected = false,- IncludeInFooterRow1 = true,- DisplayOrder = 20,- Title = "About us",- Body = "<p>Put your "About Us" information here. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "CheckoutAsGuestOrRegister",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "",- Body = "<p><strong>Register and save time!</strong><br />Register with us for future convenience:</p><ul><li>Fast and easy check out</li><li>Easy access to your order history and status</li></ul>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "ConditionsOfUse",- IncludeInSitemap = false,- IsPasswordProtected = false,- IncludeInFooterRow1 = true,- DisplayOrder = 15,- Title = "Conditions of Use",- Body = "<p>Put your conditions of use information here. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "ContactUs",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "",- Body = "<p>Put your contact information here. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "HomePageText",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "Welcome to our store",- Body = "<p>Online shopping is the process consumers go through to purchase products or services over the Internet. You can edit this in the admin site.</p><p>If you have questions, see the <a href=\"https://grandnode.com/\">Documentation</a>, or post in the <a href=\"http://www.grandnode.com/boards/\">Forums</a> at <a href=\"http://www.grandnode.com\">grandnode.com</a></p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "LoginRegistrationInfo",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "About login / registration",- Body = "<p>Put your login / registration information here. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "PrivacyInfo",- IncludeInSitemap = false,- IsPasswordProtected = false,- IncludeInFooterRow1 = true,- DisplayOrder = 10,- Title = "Privacy notice",- Body = "<p>Put your privacy policy information here. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "AccessDenied",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "",- Body = "<p><strong>Access to the page is denied .</strong></p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "PageNotFound",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "",- Body = "<p><strong>The page you requested was not found, and we have a fine guess why.</strong></p><ul><li>If you typed the URL directly, please make sure the spelling is correct.</li><li>The page longer exists. In this case, we profusely apologize for the inconvenience and for any damage this may cause.</li></ul>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "ShippingInfo",- IncludeInSitemap = false,- IsPasswordProtected = false,- IncludeInFooterRow1 = true,- DisplayOrder = 5,- Title = "Shipping & returns",- Body = "<p>Put your shipping & returns information here. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "ApplyVendor",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "",- Body = "<p>Provide information about the application process for creating a seller (vendor) account. You can edit this in the admin panel.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "VendorTermsOfService",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "",- Body = "<p>Put your terms of service information here. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "KnowledgebaseHomePage",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "",- Body = "<p>Knowledgebase homepage. You can edit this in the admin site.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- },- new Page- {- SystemName = "VendorPortalInfo",- IncludeInSitemap = false,- IsPasswordProtected = false,- DisplayOrder = 1,- Title = "Welcome to our Vendor Management Hub!",- Body = "<p>Manage your product catalog, oversee customer orders, and streamline your shipping processes. Your vendor dashboard is the command center for your success. Stay organized, serve your customers efficiently, and watch your business thrive.</p>",- PageLayoutId = defaultPageLayout.Id,- Published = true- }- };- pages.ForEach(x=>_pageRepository.Insert(x));+ var defaultPageLayout =+ _pageLayoutRepository.Table.FirstOrDefault(tt => tt.Name == "Default layout");+ if (defaultPageLayout == null)+ throw new Exception("Page layout cannot be loaded");- var lpages = from p in _pageRepository.Table- select p;- //search engine names- foreach (var page in lpages)- {- var seName = page.SystemName.ToLowerInvariant();- await _entityUrlRepository.InsertAsync(new EntityUrl- {- EntityId = page.Id,- EntityName = "Page",- LanguageId = "",- IsActive = true,- Slug = seName- });- page.SeName = seName;- await _pageRepository.UpdateAsync(page);+ var pages = new List<Page> {+ new() {+ SystemName = "AboutUs",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ IncludeInFooterRow1 = true,+ DisplayOrder = 20,+ Title = "About us",+ Body = "<p>Put your "About Us" information here. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "CheckoutAsGuestOrRegister",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "",+ Body =+ "<p><strong>Register and save time!</strong><br />Register with us for future convenience:</p><ul><li>Fast and easy check out</li><li>Easy access to your order history and status</li></ul>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "ConditionsOfUse",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ IncludeInFooterRow1 = true,+ DisplayOrder = 15,+ Title = "Conditions of Use",+ Body = "<p>Put your conditions of use information here. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "ContactUs",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "",+ Body = "<p>Put your contact information here. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "HomePageText",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "Welcome to our store",+ Body =+ "<p>Online shopping is the process consumers go through to purchase products or services over the Internet. You can edit this in the admin site.</p><p>If you have questions, see the <a href=\"https://grandnode.com/\">Documentation</a>, or post in the <a href=\"http://www.grandnode.com/boards/\">Forums</a> at <a href=\"http://www.grandnode.com\">grandnode.com</a></p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "LoginRegistrationInfo",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "About login / registration",+ Body = "<p>Put your login / registration information here. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "PrivacyInfo",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ IncludeInFooterRow1 = true,+ DisplayOrder = 10,+ Title = "Privacy notice",+ Body = "<p>Put your privacy policy information here. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "AccessDenied",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "",+ Body = "<p><strong>Access to the page is denied .</strong></p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "PageNotFound",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "",+ Body =+ "<p><strong>The page you requested was not found, and we have a fine guess why.</strong></p><ul><li>If you typed the URL directly, please make sure the spelling is correct.</li><li>The page longer exists. In this case, we profusely apologize for the inconvenience and for any damage this may cause.</li></ul>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "ShippingInfo",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ IncludeInFooterRow1 = true,+ DisplayOrder = 5,+ Title = "Shipping & returns",+ Body = "<p>Put your shipping & returns information here. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "ApplyVendor",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "",+ Body =+ "<p>Provide information about the application process for creating a seller (vendor) account. You can edit this in the admin panel.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "VendorTermsOfService",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "",+ Body = "<p>Put your terms of service information here. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "KnowledgebaseHomePage",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "",+ Body = "<p>Knowledgebase homepage. You can edit this in the admin site.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true+ },+ new() {+ SystemName = "VendorPortalInfo",+ IncludeInSitemap = false,+ IsPasswordProtected = false,+ DisplayOrder = 1,+ Title = "Welcome to our Vendor Management Hub!",+ Body =+ "<p>Manage your product catalog, oversee customer orders, and streamline your shipping processes. Your vendor dashboard is the command center for your success. Stay organized, serve your customers efficiently, and watch your business thrive.</p>",+ PageLayoutId = defaultPageLayout.Id,+ Published = true}+ };+ pages.ForEach(x => _pageRepository.Insert(x));+ var lpages = from p in _pageRepository.Table+ select p;+ //search engine names+ foreach (var page in lpages)+ {+ var seName = page.SystemName.ToLowerInvariant();+ await _entityUrlRepository.InsertAsync(new EntityUrl {+ EntityId = page.Id,+ EntityName = "Page",+ LanguageId = "",+ IsActive = true,+ Slug = seName+ });+ page.SeName = seName;+ await _pageRepository.UpdateAsync(page);}-}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataPickupPoints.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataPickupPoints.csindex f340abbf5..f7a512b81 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataPickupPoints.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataPickupPoints.cs@@ -1,27 +1,25 @@using Grand.Domain.Common;using Grand.Domain.Shipping;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallPickupPoints(){- protected virtual async Task InstallPickupPoints()- {- var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");- var addresspoint = new Address- {- Address1 = "21 West 52nd Street",- City = "New York",- StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,- CountryId = country?.Id,- ZipPostalCode = "10021"- };+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");+ var addresspoint = new Address {+ Address1 = "21 West 52nd Street",+ City = "New York",+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,+ CountryId = country?.Id,+ ZipPostalCode = "10021"+ };- var point = new PickupPoint {- Address = addresspoint,- Name = "My Store - New York"- };- await _pickupPointsRepository.InsertAsync(point);- }+ var point = new PickupPoint {+ Address = addresspoint,+ Name = "My Store - New York"+ };+ await _pickupPointsRepository.InsertAsync(point);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataProductAttributes.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataProductAttributes.csindex 59afe6ecd..1e8169b57 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataProductAttributes.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataProductAttributes.cs@@ -1,56 +1,46 @@using Grand.Domain.Catalog;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallProductAttributes(){- protected virtual Task InstallProductAttributes()- {- var productAttributes = new List<ProductAttribute>- {- new ProductAttribute- {- Name = "Color",- SeName = "color"- },- new ProductAttribute- {- Name = "Custom Text",- SeName = "custom-text"- },- new ProductAttribute- {- Name = "HDD",- SeName = "hdd"- },- new ProductAttribute- {- Name = "OS",- SeName = "os"- },- new ProductAttribute- {- Name = "Processor",- SeName = "processor"- },- new ProductAttribute- {- Name = "RAM",- SeName = "ram"- },- new ProductAttribute- {- Name = "Size",- SeName = "size"- },- new ProductAttribute- {- Name = "Software",- SeName = "software"- }- };- productAttributes.ForEach(x=>_productAttributeRepository.Insert(x));- return Task.CompletedTask;- }+ var productAttributes = new List<ProductAttribute> {+ new() {+ Name = "Color",+ SeName = "color"+ },+ new() {+ Name = "Custom Text",+ SeName = "custom-text"+ },+ new() {+ Name = "HDD",+ SeName = "hdd"+ },+ new() {+ Name = "OS",+ SeName = "os"+ },+ new() {+ Name = "Processor",+ SeName = "processor"+ },+ new() {+ Name = "RAM",+ SeName = "ram"+ },+ new() {+ Name = "Size",+ SeName = "size"+ },+ new() {+ Name = "Software",+ SeName = "software"+ }+ };+ productAttributes.ForEach(x => _productAttributeRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataProductLayouts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataProductLayouts.csindex e7649fd60..09a76db01 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataProductLayouts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataProductLayouts.cs@@ -1,28 +1,24 @@using Grand.Domain.Catalog;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallProductLayouts(){- protected virtual Task InstallProductLayouts()- {- var productLayouts = new List<ProductLayout>- {- new ProductLayout- {- Name = "Simple product",- ViewPath = "ProductLayout.Simple",- DisplayOrder = 10- },- new ProductLayout- {- Name = "Grouped product (with variants)",- ViewPath = "ProductLayout.Grouped",- DisplayOrder = 100- }- };- productLayouts.ForEach(x=>_productLayoutRepository.Insert(x));- return Task.CompletedTask;- }+ var productLayouts = new List<ProductLayout> {+ new() {+ Name = "Simple product",+ ViewPath = "ProductLayout.Simple",+ DisplayOrder = 10+ },+ new() {+ Name = "Grouped product (with variants)",+ ViewPath = "ProductLayout.Grouped",+ DisplayOrder = 100+ }+ };+ productLayouts.ForEach(x => _productLayoutRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataProducts.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataProducts.csindex ae286af8a..2d578e157 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataProducts.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataProducts.cs@@ -1,3680 +1,3621 @@using Grand.Business.Core.Extensions;using Grand.Business.Core.Interfaces.Storage;using Grand.Domain.Catalog;+using Grand.Domain.Common;using Grand.Domain.Media;using Grand.Domain.Seo;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallProducts(string defaultUserEmail){- protected virtual async Task InstallProducts(string defaultUserEmail)- {- var pictureService = _serviceProvider.GetRequiredService<IPictureService>();- var downloadService = _serviceProvider.GetRequiredService<IDownloadService>();-- var productLayoutSimple = _productLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Simple product");- if (productLayoutSimple == null)- throw new Exception("Simple product layout could not be loaded");- var productLayoutGrouped = _productLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Grouped product (with variants)");- if (productLayoutGrouped == null)- throw new Exception("Simple product layout could not be loaded");-- //delivery date- var deliveryDate = _deliveryDateRepository.Table.FirstOrDefault();- if (deliveryDate == null)- throw new Exception("No default deliveryDate could be loaded");-- //default customer/user- var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail);- if (defaultCustomer == null)- throw new Exception("Cannot load default customer");-- //pictures- var sampleImagesPath = GetSamplesPath();-- //downloads- var sampleDownloadsPath = GetSamplesPath();-- //default store- var defaultStore = _storeRepository.Table.FirstOrDefault();- if (defaultStore == null)- throw new Exception("No default store could be loaded");-- //products- var allProducts = new List<Product>();-- #region Computers--- var productBuildComputer = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Build your own computer",- ShortDescription = "Build it",- FullDescription = "<p>Fight back against cluttered workspaces with the stylish DELL Inspiron desktop PC, featuring powerful computing resources and a stunning 20.1-inch widescreen display with stunning XBRITE-HiColor LCD technology. The black IBM zBC12 has a built-in microphone and MOTION EYE camera with face-tracking technology that allows for easy communication with friends and family. And it has a built-in DVD burner and Sony's Movie Store software so you can create a digital entertainment library for personal viewing at your convenience. Easy to setup and even easier to use, this JS-series All-in-One includes an elegantly designed keyboard and a USB mouse.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 1200,- IsShipEnabled = true,- IsFreeShipping = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ShowOnHomePage = true,- ProductAttributeMappings =- {- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Processor").Id,- AttributeControlTypeId = AttributeControlType.DropdownList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "2.2 GHz Intel Pentium Dual-Core E2200",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "2.5 GHz Intel Pentium Dual-Core E2200",- IsPreSelected = true,- PriceAdjustment = 15,- DisplayOrder = 2,- }- }- },- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "RAM").Id,- AttributeControlTypeId = AttributeControlType.DropdownList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "2 GB",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "4GB",- PriceAdjustment = 20,- DisplayOrder = 2,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "8GB",- PriceAdjustment = 60,- DisplayOrder = 3,- }+ var pictureService = _serviceProvider.GetRequiredService<IPictureService>();+ var downloadService = _serviceProvider.GetRequiredService<IDownloadService>();++ var productLayoutSimple = _productLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Simple product");+ if (productLayoutSimple == null)+ throw new Exception("Simple product layout could not be loaded");+ var productLayoutGrouped =+ _productLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Grouped product (with variants)");+ if (productLayoutGrouped == null)+ throw new Exception("Simple product layout could not be loaded");++ //delivery date+ var deliveryDate = _deliveryDateRepository.Table.FirstOrDefault();+ if (deliveryDate == null)+ throw new Exception("No default deliveryDate could be loaded");++ //default customer/user+ var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail);+ if (defaultCustomer == null)+ throw new Exception("Cannot load default customer");++ //pictures+ var sampleImagesPath = GetSamplesPath();++ //downloads+ var sampleDownloadsPath = GetSamplesPath();++ //default store+ var defaultStore = _storeRepository.Table.FirstOrDefault();+ if (defaultStore == null)+ throw new Exception("No default store could be loaded");++ //products+ var allProducts = new List<Product>();++ #region Computers++ var productBuildComputer = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Build your own computer",+ ShortDescription = "Build it",+ FullDescription =+ "<p>Fight back against cluttered workspaces with the stylish DELL Inspiron desktop PC, featuring powerful computing resources and a stunning 20.1-inch widescreen display with stunning XBRITE-HiColor LCD technology. The black IBM zBC12 has a built-in microphone and MOTION EYE camera with face-tracking technology that allows for easy communication with friends and family. And it has a built-in DVD burner and Sony's Movie Store software so you can create a digital entertainment library for personal viewing at your convenience. Easy to setup and even easier to use, this JS-series All-in-One includes an elegantly designed keyboard and a USB mouse.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 1200,+ IsShipEnabled = true,+ IsFreeShipping = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ShowOnHomePage = true,+ ProductAttributeMappings = {+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Processor").Id,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "2.2 GHz Intel Pentium Dual-Core E2200",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "2.5 GHz Intel Pentium Dual-Core E2200",+ IsPreSelected = true,+ PriceAdjustment = 15,+ DisplayOrder = 2}- },- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "HDD").Id,- AttributeControlTypeId = AttributeControlType.RadioList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "320 GB",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "400 GB",- PriceAdjustment = 100,- DisplayOrder = 2,- }+ }+ },+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "RAM").Id,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "2 GB",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "4GB",+ PriceAdjustment = 20,+ DisplayOrder = 2+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "8GB",+ PriceAdjustment = 60,+ DisplayOrder = 3}- },- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "OS").Id,- AttributeControlTypeId = AttributeControlType.RadioList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Vista Home",- PriceAdjustment = 50,- IsPreSelected = true,- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Vista Premium",- PriceAdjustment = 60,- DisplayOrder = 2,- }+ }+ },+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "HDD").Id,+ AttributeControlTypeId = AttributeControlType.RadioList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "320 GB",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "400 GB",+ PriceAdjustment = 100,+ DisplayOrder = 2}- },- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Software").Id,- AttributeControlTypeId = AttributeControlType.Checkboxes,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Microsoft Office",- PriceAdjustment = 50,- IsPreSelected = true,- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Acrobat Reader",- PriceAdjustment = 10,- DisplayOrder = 2,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Total Commander",- PriceAdjustment = 5,- DisplayOrder = 2,- }+ }+ },+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "OS").Id,+ AttributeControlTypeId = AttributeControlType.RadioList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Vista Home",+ PriceAdjustment = 50,+ IsPreSelected = true,+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Vista Premium",+ PriceAdjustment = 60,+ DisplayOrder = 2}}},- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,- DisplayOrder = 1,+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Software").Id,+ AttributeControlTypeId = AttributeControlType.Checkboxes,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Microsoft Office",+ PriceAdjustment = 50,+ IsPreSelected = true,+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Acrobat Reader",+ PriceAdjustment = 10,+ DisplayOrder = 2+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Total Commander",+ PriceAdjustment = 5,+ DisplayOrder = 2+ }}}- };- allProducts.Add(productBuildComputer);-- var picture1 = await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_desktop_1.png"), "image/png", pictureService.GetPictureSeName(productBuildComputer.Name), reference: Domain.Common.Reference.Product, objectId: productBuildComputer.Id);- var picture2 = await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_desktop_2.png"), "image/png", pictureService.GetPictureSeName(productBuildComputer.Name), reference: Domain.Common.Reference.Product, objectId: productBuildComputer.Id);-- await _productRepository.InsertAsync(productBuildComputer);-- var productpicture1 = new ProductPicture- {- PictureId = picture1.Id,- DisplayOrder = 1- };- var productpicture2 = new ProductPicture- {- PictureId = picture2.Id,- DisplayOrder = 1- };- productBuildComputer.ProductPictures.Add(productpicture1);- productBuildComputer.ProductPictures.Add(productpicture2);- await _productRepository.UpdateAsync(productBuildComputer);-- var productSonyPS5Pad = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Playstation 5 Gamepad",- ShortDescription = "The DualSense wireless controller for PS5 offers realistic touch effects2, adaptive 'Trigger' effects and a built-in microphone - all integrated into an iconic design.",- FullDescription = "<p>The DualSense wireless controller for PS5 offers realistic touch effects2, adaptive 'Trigger' effects and a built-in microphone - all integrated into an iconic design.</p><p>Feel a physical reaction to your in-game actions thanks to dual actuators that replace traditional vibration motors. Such dynamic vibrations in your hands can simulate the tactile sensations of many things, from the world around you to the recoil of various weapons.</p><p>Enjoy intuitive motion controls for selected games thanks to the built-in accelerometer and gyroscope.</p><p>Chat with friends online using the built-in microphone or by plugging a headset into the 3.5mm jack. With the dedicated MUTE button you can disable voice recording.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 59,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,- DisplayOrder = 1,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,+ DisplayOrder = 1}-- };-- allProducts.Add(productSonyPS5Pad);- productSonyPS5Pad.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_pad_1.png"), "image/png", pictureService.GetPictureSeName(productSonyPS5Pad.Name), reference: Domain.Common.Reference.Product, objectId: productSonyPS5Pad.Id)).Id,- DisplayOrder = 1,- });- productSonyPS5Pad.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_pad_2.png"), "image/png", pictureService.GetPictureSeName(productSonyPS5Pad.Name), reference: Domain.Common.Reference.Product, objectId: productSonyPS5Pad.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productSonyPS5Pad);-- var productLenovoIdeaPadDual = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Lenovo IdeaPad Dual 3i",- ShortDescription = "Get dependable performance for work and play from the Dual 3i’s Intel® Pentium® processor, which gives you the ability to effortlessly multitask with multi-screen capabilities.",- FullDescription = "<p>Get dependable performance for work and play from the Duet 3i’s Intel® Pentium® processor, which gives you the ability to effortlessly multitask with multi-screen capabilities, communicate easily with friends and family, and take all your favorite entertainment to go.</p><p>Work more freely on the elegant IdeaPad Duet 3i than on a regular laptop. The detachable Bluetooth keyboard allows you to easily switch between laptop and tablet modes, and the stand makes it easy to position your computer on any surface. The laptop runs on the power of an Intel® Pentium® processor, and the HD touchscreen, Dolby Audio ™ sound and optional LTE connectivity will keep you entertained anywhere.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 99,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productBuildComputer);++ var picture1 = await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_desktop_1.png"),+ "image/png", pictureService.GetPictureSeName(productBuildComputer.Name), reference: Reference.Product,+ objectId: productBuildComputer.Id);+ var picture2 = await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_desktop_2.png"),+ "image/png", pictureService.GetPictureSeName(productBuildComputer.Name), reference: Reference.Product,+ objectId: productBuildComputer.Id);++ await _productRepository.InsertAsync(productBuildComputer);++ var productpicture1 = new ProductPicture {+ PictureId = picture1.Id,+ DisplayOrder = 1+ };+ var productpicture2 = new ProductPicture {+ PictureId = picture2.Id,+ DisplayOrder = 1+ };+ productBuildComputer.ProductPictures.Add(productpicture1);+ productBuildComputer.ProductPictures.Add(productpicture2);+ await _productRepository.UpdateAsync(productBuildComputer);++ var productSonyPS5Pad = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Playstation 5 Gamepad",+ ShortDescription =+ "The DualSense wireless controller for PS5 offers realistic touch effects2, adaptive 'Trigger' effects and a built-in microphone - all integrated into an iconic design.",+ FullDescription =+ "<p>The DualSense wireless controller for PS5 offers realistic touch effects2, adaptive 'Trigger' effects and a built-in microphone - all integrated into an iconic design.</p><p>Feel a physical reaction to your in-game actions thanks to dual actuators that replace traditional vibration motors. Such dynamic vibrations in your hands can simulate the tactile sensations of many things, from the world around you to the recoil of various weapons.</p><p>Enjoy intuitive motion controls for selected games thanks to the built-in accelerometer and gyroscope.</p><p>Chat with friends online using the built-in microphone or by plugging a headset into the 3.5mm jack. With the dedicated MUTE button you can disable voice recording.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 59,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,+ DisplayOrder = 1}- };- allProducts.Add(productLenovoIdeaPadDual);- productLenovoIdeaPadDual.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_ideapad_dual_1.png"), "image/png", pictureService.GetPictureSeName(productLenovoIdeaPadDual.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoIdeaPadDual.Id)).Id,- DisplayOrder = 1,- });- productLenovoIdeaPadDual.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_ideapad_dual_2.png"), "image/png", pictureService.GetPictureSeName(productLenovoIdeaPadDual.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoIdeaPadDual.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productLenovoIdeaPadDual);-- #endregion-- #region Notebooks-- var productMiNotebook = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Mi Notebook 14",- ShortDescription = "Designed with utmost patience and craftsmanship, the Mi NoteBook 14 is so beautiful that you can't help but notice it. Weighing just 1.5kg, the sleek unibody metal chassis and an anodized sandblasted coating makes your device sturdy and gives it a svelte look.",- FullDescription = "<p>Designed with utmost patience and craftsmanship, the Mi NoteBook 14 is so beautiful that you can't help but notice it. Weighing just 1.5kg, the sleek unibody metal chassis and an anodized sandblasted coating makes your device sturdy and gives it a slim look.</p><p>With the power-efficient NVIDIA® GeForce® MX250 graphics, now enjoy incredible HD photo and video editing, faster and smoother gaming. The powerful graphics engine and next-gen technologies gives you performance you desire.</p><p>The Mi Notebook 14 offers great clock speeds at 2666MHz, and thus makes you say goodbye to slow and insufficient memory. This helps you multi-task with your favorite editing/productivity tools and casual games.</p><p>Comes with a wider air intake area of 2530mm² and a large diameter fan which brings excellent cooling to the whole machine. This keeps your machine cool so that you can hold onto yours. The maximum sound of the fan is a mere 37 dB even when the system is loaded to its max.</p><p>Based on the scissor mechanism, the keys have ABS texture and a travel distance of 1.3mm which makes typing a lot more comfortable and low-profile on this device. The in-built dust protection layer is also an excellent addition.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 1800,- OldPrice = 2000,- IsShipEnabled = true,- IsFreeShipping = true,- Weight = 3,- Length = 3,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ShowOnHomePage = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,- DisplayOrder = 1,- }+ }+ };++ allProducts.Add(productSonyPS5Pad);+ productSonyPS5Pad.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_pad_1.png"), "image/png",+ pictureService.GetPictureSeName(productSonyPS5Pad.Name), reference: Reference.Product,+ objectId: productSonyPS5Pad.Id)).Id,+ DisplayOrder = 1+ });+ productSonyPS5Pad.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_pad_2.png"), "image/png",+ pictureService.GetPictureSeName(productSonyPS5Pad.Name), reference: Reference.Product,+ objectId: productSonyPS5Pad.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productSonyPS5Pad);++ var productLenovoIdeaPadDual = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Lenovo IdeaPad Dual 3i",+ ShortDescription =+ "Get dependable performance for work and play from the Dual 3i’s Intel® Pentium® processor, which gives you the ability to effortlessly multitask with multi-screen capabilities.",+ FullDescription =+ "<p>Get dependable performance for work and play from the Duet 3i’s Intel® Pentium® processor, which gives you the ability to effortlessly multitask with multi-screen capabilities, communicate easily with friends and family, and take all your favorite entertainment to go.</p><p>Work more freely on the elegant IdeaPad Duet 3i than on a regular laptop. The detachable Bluetooth keyboard allows you to easily switch between laptop and tablet modes, and the stand makes it easy to position your computer on any surface. The laptop runs on the power of an Intel® Pentium® processor, and the HD touchscreen, Dolby Audio ™ sound and optional LTE connectivity will keep you entertained anywhere.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 99,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productLenovoIdeaPadDual);+ productLenovoIdeaPadDual.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_ideapad_dual_1.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoIdeaPadDual.Name), reference: Reference.Product,+ objectId: productLenovoIdeaPadDual.Id)).Id,+ DisplayOrder = 1+ });+ productLenovoIdeaPadDual.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_ideapad_dual_2.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoIdeaPadDual.Name), reference: Reference.Product,+ objectId: productLenovoIdeaPadDual.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productLenovoIdeaPadDual);++ #endregion++ #region Notebooks++ var productMiNotebook = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Mi Notebook 14",+ ShortDescription =+ "Designed with utmost patience and craftsmanship, the Mi NoteBook 14 is so beautiful that you can't help but notice it. Weighing just 1.5kg, the sleek unibody metal chassis and an anodized sandblasted coating makes your device sturdy and gives it a svelte look.",+ FullDescription =+ "<p>Designed with utmost patience and craftsmanship, the Mi NoteBook 14 is so beautiful that you can't help but notice it. Weighing just 1.5kg, the sleek unibody metal chassis and an anodized sandblasted coating makes your device sturdy and gives it a slim look.</p><p>With the power-efficient NVIDIA® GeForce® MX250 graphics, now enjoy incredible HD photo and video editing, faster and smoother gaming. The powerful graphics engine and next-gen technologies gives you performance you desire.</p><p>The Mi Notebook 14 offers great clock speeds at 2666MHz, and thus makes you say goodbye to slow and insufficient memory. This helps you multi-task with your favorite editing/productivity tools and casual games.</p><p>Comes with a wider air intake area of 2530mm² and a large diameter fan which brings excellent cooling to the whole machine. This keeps your machine cool so that you can hold onto yours. The maximum sound of the fan is a mere 37 dB even when the system is loaded to its max.</p><p>Based on the scissor mechanism, the keys have ABS texture and a travel distance of 1.3mm which makes typing a lot more comfortable and low-profile on this device. The in-built dust protection layer is also an excellent addition.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 1800,+ OldPrice = 2000,+ IsShipEnabled = true,+ IsFreeShipping = true,+ Weight = 3,+ Length = 3,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ShowOnHomePage = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,+ DisplayOrder = 1+ }+ },+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,+ ProductSpecificationAttributes = {+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 1,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions+ .Single(sao => sao.Name == "13.0''").Id},- BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,- ProductSpecificationAttributes =- {- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 1,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "13.0''").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 2,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 3,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "4 GB").Id- }+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 2,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions+ .Single(sao => sao.Name == "Intel Core i5").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 3,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions+ .Single(sao => sao.Name == "4 GB").Id}- };- allProducts.Add(productMiNotebook);- productMiNotebook.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_mi_notebook_1.png"), "image/png", pictureService.GetPictureSeName(productMiNotebook.Name), reference: Domain.Common.Reference.Product, objectId: productMiNotebook.Id)).Id,- DisplayOrder = 1,- });- productMiNotebook.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_mi_notebook_2.png"), "image/png", pictureService.GetPictureSeName(productMiNotebook.Name), reference: Domain.Common.Reference.Product, objectId: productMiNotebook.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productMiNotebook);--- var productLenovoLegionY740 = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Lenovo Legion Y740",- ShortDescription = "The 17.3 ”Y740 Legion is a gaming masterpiece. You will be immersed in the action thanks to best-in-class Corsair iCUE lighting and Dolby realistic image and surround sound technologies.",- FullDescription = "<p>The 17.3 ”Y740 Legion is a gaming masterpiece. You will be immersed in the action thanks to best-in-class Corsair iCUE lighting and Dolby realistic image and surround sound technologies. Check out what the Lenovo Legion Y740 looks like in reality.Grab the photo below and drag it left or right to rotate the product, or use the navigation buttons.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 1500,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productMiNotebook);+ productMiNotebook.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_mi_notebook_1.png"), "image/png",+ pictureService.GetPictureSeName(productMiNotebook.Name), reference: Reference.Product,+ objectId: productMiNotebook.Id)).Id,+ DisplayOrder = 1+ });+ productMiNotebook.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_mi_notebook_2.png"), "image/png",+ pictureService.GetPictureSeName(productMiNotebook.Name), reference: Reference.Product,+ objectId: productMiNotebook.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productMiNotebook);+++ var productLenovoLegionY740 = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Lenovo Legion Y740",+ ShortDescription =+ "The 17.3 ”Y740 Legion is a gaming masterpiece. You will be immersed in the action thanks to best-in-class Corsair iCUE lighting and Dolby realistic image and surround sound technologies.",+ FullDescription =+ "<p>The 17.3 ”Y740 Legion is a gaming masterpiece. You will be immersed in the action thanks to best-in-class Corsair iCUE lighting and Dolby realistic image and surround sound technologies. Check out what the Lenovo Legion Y740 looks like in reality.Grab the photo below and drag it left or right to rotate the product, or use the navigation buttons.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 1500,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,+ DisplayOrder = 1+ }+ },+ ProductSpecificationAttributes = {+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 1,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions+ .Single(sao => sao.Name == "15.6''").Id},- ProductSpecificationAttributes =- {- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 1,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.6''").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 2,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 3,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "16 GB").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 4,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "1 TB").Id- }+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 2,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions+ .Single(sao => sao.Name == "Intel Core i7").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 3,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions+ .Single(sao => sao.Name == "16 GB").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 4,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions+ .Single(sao => sao.Name == "1 TB").Id}- };- allProducts.Add(productLenovoLegionY740);- productLenovoLegionY740.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_legion_y740_1.png"), "image/png", pictureService.GetPictureSeName(productLenovoLegionY740.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoLegionY740.Id)).Id,- DisplayOrder = 1,- });- productLenovoLegionY740.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_legion_y740_2.png"), "image/png", pictureService.GetPictureSeName(productLenovoLegionY740.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoLegionY740.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productLenovoLegionY740);--- var productPs5Camera = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Playstation 5 Camera",- ShortDescription = "Use the new Sony HD Camera for PlayStation 5 to show other players your reactions during the game.",- FullDescription = "<p>Use the new Sony HD Camera for PlayStation 5 to show other players your reactions during the game. Equipped with two lenses, the camera can record images in 1080p quality and works seamlessly with the PS5 background removal tools. They put you in the spotlight of viewers. In addition, the camera has been equipped with a stand that makes it easy to mount it above or below the TV.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 150,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productLenovoLegionY740);+ productLenovoLegionY740.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_legion_y740_1.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoLegionY740.Name), reference: Reference.Product,+ objectId: productLenovoLegionY740.Id)).Id,+ DisplayOrder = 1+ });+ productLenovoLegionY740.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_legion_y740_2.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoLegionY740.Name), reference: Reference.Product,+ objectId: productLenovoLegionY740.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productLenovoLegionY740);+++ var productPs5Camera = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Playstation 5 Camera",+ ShortDescription =+ "Use the new Sony HD Camera for PlayStation 5 to show other players your reactions during the game.",+ FullDescription =+ "<p>Use the new Sony HD Camera for PlayStation 5 to show other players your reactions during the game. Equipped with two lenses, the camera can record images in 1080p quality and works seamlessly with the PS5 background removal tools. They put you in the spotlight of viewers. In addition, the camera has been equipped with a stand that makes it easy to mount it above or below the TV.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 150,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,+ DisplayOrder = 1+ }+ },+ ProductSpecificationAttributes = {+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 1,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions+ .Single(sao => sao.Name == "15.0''").Id},- ProductSpecificationAttributes =- {- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 1,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.0''").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 2,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 3,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "8 GB").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 4,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "128 GB").Id- }+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 2,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions+ .Single(sao => sao.Name == "Intel Core i5").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 3,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions+ .Single(sao => sao.Name == "8 GB").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 4,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions+ .Single(sao => sao.Name == "128 GB").Id}- };- allProducts.Add(productPs5Camera);- productPs5Camera.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps5_camera_1.png"), "image/png", pictureService.GetPictureSeName(productPs5Camera.Name), reference: Domain.Common.Reference.Product, objectId: productPs5Camera.Id)).Id,- DisplayOrder = 1,- });- productPs5Camera.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps5_camera_2.png"), "image/png", pictureService.GetPictureSeName(productPs5Camera.Name), reference: Domain.Common.Reference.Product, objectId: productPs5Camera.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productPs5Camera);-- var productAcerNitro = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Acer Nitro 5",- ShortDescription = "Experience a new dimension of gameplay with the Acer Nitro 5 laptop. Equipped with a powerful Intel Core i5 processor and GTX1050 graphics card, it is able to cope with even the most demanding tasks.",- FullDescription = "<p>Experience a new dimension of gameplay with the Acer Nitro 5 laptop. Equipped with a powerful Intel Core i5 processor and GTX1050 graphics card, it is able to cope with even the most demanding tasks. Additionally, the matrix in IPS technology will ensure high quality of the displayed image, good color reproduction and wide viewing angles. The Acer Nitro 5 laptop is the perfect choice for both gaming and work. Dominate the virtual battlefield with the GeForce GTX 1050 graphics card, featuring the groundbreaking NVIDIA Pascal architecture. Excellent performance, innovative gaming technologies and support for DirectX 12 libraries will allow you to immerse yourself in phenomenal 4K resolution, enriched with HDR mode, or play in an amazingly realistic VR scenery. Every time without cuts or delays, every time on high details. Play the latest, most challenging games the way they deserve.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 1350,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productPs5Camera);+ productPs5Camera.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_ps5_camera_1.png"), "image/png",+ pictureService.GetPictureSeName(productPs5Camera.Name), reference: Reference.Product,+ objectId: productPs5Camera.Id)).Id,+ DisplayOrder = 1+ });+ productPs5Camera.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_ps5_camera_2.png"), "image/png",+ pictureService.GetPictureSeName(productPs5Camera.Name), reference: Reference.Product,+ objectId: productPs5Camera.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productPs5Camera);++ var productAcerNitro = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Acer Nitro 5",+ ShortDescription =+ "Experience a new dimension of gameplay with the Acer Nitro 5 laptop. Equipped with a powerful Intel Core i5 processor and GTX1050 graphics card, it is able to cope with even the most demanding tasks.",+ FullDescription =+ "<p>Experience a new dimension of gameplay with the Acer Nitro 5 laptop. Equipped with a powerful Intel Core i5 processor and GTX1050 graphics card, it is able to cope with even the most demanding tasks. Additionally, the matrix in IPS technology will ensure high quality of the displayed image, good color reproduction and wide viewing angles. The Acer Nitro 5 laptop is the perfect choice for both gaming and work. Dominate the virtual battlefield with the GeForce GTX 1050 graphics card, featuring the groundbreaking NVIDIA Pascal architecture. Excellent performance, innovative gaming technologies and support for DirectX 12 libraries will allow you to immerse yourself in phenomenal 4K resolution, enriched with HDR mode, or play in an amazingly realistic VR scenery. Every time without cuts or delays, every time on high details. Play the latest, most challenging games the way they deserve.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 1350,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,+ DisplayOrder = 1+ }+ },+ ProductSpecificationAttributes = {+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 1,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions+ .Single(sao => sao.Name == "13.3''").Id},- ProductSpecificationAttributes =- {- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 1,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "13.3''").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 2,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i5").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 3,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "4 GB").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 4,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "128 GB").Id- }+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 2,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions+ .Single(sao => sao.Name == "Intel Core i5").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 3,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions+ .Single(sao => sao.Name == "4 GB").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 4,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions+ .Single(sao => sao.Name == "128 GB").Id}- };- allProducts.Add(productAcerNitro);- productAcerNitro.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_acer_nitro_1.png"), "image/png", pictureService.GetPictureSeName(productAcerNitro.Name), reference: Domain.Common.Reference.Product, objectId: productAcerNitro.Id)).Id,- DisplayOrder = 1,- });- productAcerNitro.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_acer_nitro_2.png"), "image/png", pictureService.GetPictureSeName(productAcerNitro.Name), reference: Domain.Common.Reference.Product, objectId: productAcerNitro.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productAcerNitro);--- var productDellG5 = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Dell Inspiron G5",- ShortDescription = "The Dell Inspiron G5 is a 15-inch gaming notebook with fantastic graphics capabilities, thanks to the NVIDIA® GeForce® GTX 1060 Max-Q graphics card, the latest 8th generation Intel® Core ™ i7 hexa-core processor and efficient DDR4 2666MHz RAM memory. The Inspiron G5 is designed specifically with the specific, demanding needs of gaming enthusiasts in mind.",- FullDescription = "The Dell Inspiron G5 is a 15-inch gaming notebook with fantastic graphics capabilities, thanks to the NVIDIA® GeForce® GTX 1060 Max-Q graphics card, the latest 8th generation Intel® Core ™ i7 hexa-core processor and efficient DDR4 2666MHz RAM memory. The Inspiron G5 is designed specifically with the specific, demanding needs of gaming enthusiasts in mind.</p><p>The enormous performance, speed and dynamics of the eighth generation Intel Core i7 Coffee Lake processor is a guarantee of the highest performance in gaming and smooth operation with advanced applications. When more power is needed, Turbo Boost 2.0 technology intelligently speeds up the clock speed, unleashing the maximum potential of each CPU core. In addition, the unit flawlessly supports the highest definition video as well as spherical videos, while ensuring the security of transactions concluded on the network.</p><p>Play the latest, most demanding games with GeForce GTX 1060 Max-Q. Pull the sliders to the maximum and admire virtual worlds in 4K quality, enriched with HDR mode and DirectX 12 functions. All this with excellent smoothness of the image, without lag and clipping, thanks to the breakthrough architecture of Pascal GPU, packed with technologies for players.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 1460,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productAcerNitro);+ productAcerNitro.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_acer_nitro_1.png"), "image/png",+ pictureService.GetPictureSeName(productAcerNitro.Name), reference: Reference.Product,+ objectId: productAcerNitro.Id)).Id,+ DisplayOrder = 1+ });+ productAcerNitro.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_acer_nitro_2.png"), "image/png",+ pictureService.GetPictureSeName(productAcerNitro.Name), reference: Reference.Product,+ objectId: productAcerNitro.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productAcerNitro);+++ var productDellG5 = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Dell Inspiron G5",+ ShortDescription =+ "The Dell Inspiron G5 is a 15-inch gaming notebook with fantastic graphics capabilities, thanks to the NVIDIA® GeForce® GTX 1060 Max-Q graphics card, the latest 8th generation Intel® Core ™ i7 hexa-core processor and efficient DDR4 2666MHz RAM memory. The Inspiron G5 is designed specifically with the specific, demanding needs of gaming enthusiasts in mind.",+ FullDescription =+ "The Dell Inspiron G5 is a 15-inch gaming notebook with fantastic graphics capabilities, thanks to the NVIDIA® GeForce® GTX 1060 Max-Q graphics card, the latest 8th generation Intel® Core ™ i7 hexa-core processor and efficient DDR4 2666MHz RAM memory. The Inspiron G5 is designed specifically with the specific, demanding needs of gaming enthusiasts in mind.</p><p>The enormous performance, speed and dynamics of the eighth generation Intel Core i7 Coffee Lake processor is a guarantee of the highest performance in gaming and smooth operation with advanced applications. When more power is needed, Turbo Boost 2.0 technology intelligently speeds up the clock speed, unleashing the maximum potential of each CPU core. In addition, the unit flawlessly supports the highest definition video as well as spherical videos, while ensuring the security of transactions concluded on the network.</p><p>Play the latest, most demanding games with GeForce GTX 1060 Max-Q. Pull the sliders to the maximum and admire virtual worlds in 4K quality, enriched with HDR mode and DirectX 12 functions. All this with excellent smoothness of the image, without lag and clipping, thanks to the breakthrough architecture of Pascal GPU, packed with technologies for players.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 1460,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,+ DisplayOrder = 1+ }+ },+ BrandId = _brandRepository.Table.Single(c => c.Name == "Dell").Id,+ ProductSpecificationAttributes = {+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 1,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions+ .Single(sao => sao.Name == "15.6''").Id},- BrandId = _brandRepository.Table.Single(c => c.Name == "Dell").Id,- ProductSpecificationAttributes =- {- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 1,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "15.6''").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 2,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 3,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").SpecificationAttributeOptions.Single(sao => sao.Name == "8 GB").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 4,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions.Single(sao => sao.Name == "500 GB").Id- }+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 2,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions+ .Single(sao => sao.Name == "Intel Core i7").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 3,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions+ .Single(sao => sao.Name == "8 GB").Id+ },+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 4,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions+ .Single(sao => sao.Name == "500 GB").Id}- };- allProducts.Add(productDellG5);- productDellG5.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_dell_g5_1.png"), "image/png", pictureService.GetPictureSeName(productDellG5.Name), reference: Domain.Common.Reference.Product, objectId: productDellG5.Id)).Id,- DisplayOrder = 1,- });- productDellG5.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_dell_g5_2.png"), "image/png", pictureService.GetPictureSeName(productDellG5.Name), reference: Domain.Common.Reference.Product, objectId: productDellG5.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productDellG5);--- var productDellXPS = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Dell XPS",- ShortDescription = "Dell laptop with a screen size of 13.4 inches and a resolution of 1920 x 1200 pixels. It is equipped with an Intel Core i7-1065G7 processor with a clock frequency of 1.3 - 3.9 GHz, DDR4 RAM memory with a size of 16 GB. 1000 GB SSD hard drive. Intel HD Graphics.",- FullDescription = "<p>Dell laptop with a screen size of 13.4 inches and a resolution of 1920 x 1200 pixels. It is equipped with an Intel Core i7-1065G7 processor with a clock frequency of 1.3 - 3.9 GHz, DDR4 RAM memory with a size of 16 GB. 1000 GB SSD hard drive. Intel HD Graphics. Graphics card size shared with RA, integrated. The installed operating system is Windows 10 Home.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 1360,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productDellG5);+ productDellG5.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_dell_g5_1.png"), "image/png",+ pictureService.GetPictureSeName(productDellG5.Name), reference: Reference.Product,+ objectId: productDellG5.Id)).Id,+ DisplayOrder = 1+ });+ productDellG5.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_dell_g5_2.png"), "image/png",+ pictureService.GetPictureSeName(productDellG5.Name), reference: Reference.Product,+ objectId: productDellG5.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productDellG5);+++ var productDellXPS = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Dell XPS",+ ShortDescription =+ "Dell laptop with a screen size of 13.4 inches and a resolution of 1920 x 1200 pixels. It is equipped with an Intel Core i7-1065G7 processor with a clock frequency of 1.3 - 3.9 GHz, DDR4 RAM memory with a size of 16 GB. 1000 GB SSD hard drive. Intel HD Graphics.",+ FullDescription =+ "<p>Dell laptop with a screen size of 13.4 inches and a resolution of 1920 x 1200 pixels. It is equipped with an Intel Core i7-1065G7 processor with a clock frequency of 1.3 - 3.9 GHz, DDR4 RAM memory with a size of 16 GB. 1000 GB SSD hard drive. Intel HD Graphics. Graphics card size shared with RA, integrated. The installed operating system is Windows 10 Home.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 1360,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,+ DisplayOrder = 1+ }+ },+ BrandId = _brandRepository.Table.Single(c => c.Name == "Dell").Id,+ ProductSpecificationAttributes = {+ new ProductSpecificationAttribute {+ AllowFiltering = false,+ ShowOnProductPage = true,+ DisplayOrder = 1,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions+ .Single(sao => sao.Name == "14.0''").Id},- BrandId = _brandRepository.Table.Single(c => c.Name == "Dell").Id,- ProductSpecificationAttributes =- {- new ProductSpecificationAttribute- {- AllowFiltering = false,- ShowOnProductPage = true,- DisplayOrder = 1,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions.Single(sao => sao.Name == "14.0''").Id- },- new ProductSpecificationAttribute- {- AllowFiltering = true,- ShowOnProductPage = true,- DisplayOrder = 2,- SpecificationAttributeId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,- SpecificationAttributeOptionId = _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions.Single(sao => sao.Name == "Intel Core i7").Id- }+ new ProductSpecificationAttribute {+ AllowFiltering = true,+ ShowOnProductPage = true,+ DisplayOrder = 2,+ SpecificationAttributeId =+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions+ .Single(sao => sao.Name == "Intel Core i7").Id}- };- allProducts.Add(productDellXPS);- productDellXPS.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_dell_xps_1.png"), "image/png", pictureService.GetPictureSeName(productDellXPS.Name), reference: Domain.Common.Reference.Product, objectId: productDellXPS.Id)).Id,- DisplayOrder = 1,- });- productDellXPS.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_dell_xps_2.png"), "image/png", pictureService.GetPictureSeName(productDellXPS.Name), reference: Domain.Common.Reference.Product, objectId: productDellXPS.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productDellXPS);-- #endregion-- #region Accessories--- var productLenovoYogaDuet = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Lenovo Yoga Duet",- ShortDescription = "The adjustable stand allows for more convenient and effective work, sketching or taking notes in laptop mode or at a lower angle. The detachable Bluetooth® keyboard allows you to write and look at the screen with even more freedom.",- FullDescription = "<p>Weighing just 1.16 kg, the Yoga Duet 7i is light and versatile enough to be used anywhere. The adjustable stand allows for more convenient and effective work, sketching or taking notes in laptop mode or at a lower angle. The detachable Bluetooth® keyboard allows you to write and look at the screen with even more freedom.</p><p>The Yoga Duet 7i is an advanced mobile device that is not only intuitive to use and easily personalized, but also uncompromisingly efficient. How is this possible? Powered by the 10th Gen Intel® Core ™ processor and artificial intelligence features that dynamically adjust power to optimize battery life. So it works for up to 10.8 hours on a single charge. It also has USB-C ports for faster charging.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 75,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productDellXPS);+ productDellXPS.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_dell_xps_1.png"), "image/png",+ pictureService.GetPictureSeName(productDellXPS.Name), reference: Reference.Product,+ objectId: productDellXPS.Id)).Id,+ DisplayOrder = 1+ });+ productDellXPS.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_dell_xps_2.png"), "image/png",+ pictureService.GetPictureSeName(productDellXPS.Name), reference: Reference.Product,+ objectId: productDellXPS.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productDellXPS);++ #endregion++ #region Accessories++ var productLenovoYogaDuet = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Lenovo Yoga Duet",+ ShortDescription =+ "The adjustable stand allows for more convenient and effective work, sketching or taking notes in laptop mode or at a lower angle. The detachable Bluetooth® keyboard allows you to write and look at the screen with even more freedom.",+ FullDescription =+ "<p>Weighing just 1.16 kg, the Yoga Duet 7i is light and versatile enough to be used anywhere. The adjustable stand allows for more convenient and effective work, sketching or taking notes in laptop mode or at a lower angle. The detachable Bluetooth® keyboard allows you to write and look at the screen with even more freedom.</p><p>The Yoga Duet 7i is an advanced mobile device that is not only intuitive to use and easily personalized, but also uncompromisingly efficient. How is this possible? Powered by the 10th Gen Intel® Core ™ processor and artificial intelligence features that dynamically adjust power to optimize battery life. So it works for up to 10.8 hours on a single charge. It also has USB-C ports for faster charging.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 75,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,+ DisplayOrder = 1}- };- allProducts.Add(productLenovoYogaDuet);- productLenovoYogaDuet.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_yoga_duet_1.png"), "image/png", pictureService.GetPictureSeName(productLenovoYogaDuet.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoYogaDuet.Id)).Id,- DisplayOrder = 1,- });- productLenovoYogaDuet.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_yoga_duet_2.png"), "image/png", pictureService.GetPictureSeName(productLenovoYogaDuet.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoYogaDuet.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productLenovoYogaDuet);--- var productLenovoSmartTab = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Lenovo Smart Tab",- ShortDescription = "The most versatile entertainment tablet now can do even more.",- FullDescription = "<p>The most versatile entertainment tablet now can do even more. Lenovo Yoga Smart Tab with Google Assistant is a development of the groundbreaking Yoga Tab 3 with a stand for working in various modes. This tablet offers high-end entertainment features such as an IPS display with FHD resolution and two JBL® stereo speakers. Additionally, it also acts as a digital home control center. The built-in LTE modem ensures permanent access to the Internet.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 65,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productLenovoYogaDuet);+ productLenovoYogaDuet.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_yoga_duet_1.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoYogaDuet.Name), reference: Reference.Product,+ objectId: productLenovoYogaDuet.Id)).Id,+ DisplayOrder = 1+ });+ productLenovoYogaDuet.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_yoga_duet_2.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoYogaDuet.Name), reference: Reference.Product,+ objectId: productLenovoYogaDuet.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productLenovoYogaDuet);+++ var productLenovoSmartTab = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Lenovo Smart Tab",+ ShortDescription = "The most versatile entertainment tablet now can do even more.",+ FullDescription =+ "<p>The most versatile entertainment tablet now can do even more. Lenovo Yoga Smart Tab with Google Assistant is a development of the groundbreaking Yoga Tab 3 with a stand for working in various modes. This tablet offers high-end entertainment features such as an IPS display with FHD resolution and two JBL® stereo speakers. Additionally, it also acts as a digital home control center. The built-in LTE modem ensures permanent access to the Internet.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 65,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,+ DisplayOrder = 1}- };- allProducts.Add(productLenovoSmartTab);- productLenovoSmartTab.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_smart_tab_1.png"), "image/png", pictureService.GetPictureSeName(productLenovoSmartTab.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoSmartTab.Id)).Id,- DisplayOrder = 1,- });- productLenovoSmartTab.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lenovo_smart_tab_2.png"), "image/png", pictureService.GetPictureSeName(productLenovoSmartTab.Name), reference: Domain.Common.Reference.Product, objectId: productLenovoSmartTab.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productLenovoSmartTab);--- var productAsusMixedReality = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Asus Mixed Reality",- ShortDescription = "Explore exciting new virtual worlds with the ASUS Windows Mixed Reality Headset!",- FullDescription = "<p>Explore exciting new virtual worlds with the ASUS Windows Mixed Reality Headset! It features a unique and beautiful 3D-pattern aesthetic and a comfy weight-balanced design with premium antibacterial cushioned materials, so it’s not only stylish but also supremely cool and comfortable for extended periods of exploring. Unlike other headsets, the ASUS Windows Mixed Reality Headset doesn’t need any external sensors, making initial set up super easy — you’ll be ready to play in 10 minutes or less*! It’s the revolutionary, easy-to-use and affordable way to explore your imagination.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 399,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productLenovoSmartTab);+ productLenovoSmartTab.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_smart_tab_1.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoSmartTab.Name), reference: Reference.Product,+ objectId: productLenovoSmartTab.Id)).Id,+ DisplayOrder = 1+ });+ productLenovoSmartTab.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_smart_tab_2.png"), "image/png",+ pictureService.GetPictureSeName(productLenovoSmartTab.Name), reference: Reference.Product,+ objectId: productLenovoSmartTab.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productLenovoSmartTab);+++ var productAsusMixedReality = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Asus Mixed Reality",+ ShortDescription = "Explore exciting new virtual worlds with the ASUS Windows Mixed Reality Headset!",+ FullDescription =+ "<p>Explore exciting new virtual worlds with the ASUS Windows Mixed Reality Headset! It features a unique and beautiful 3D-pattern aesthetic and a comfy weight-balanced design with premium antibacterial cushioned materials, so it’s not only stylish but also supremely cool and comfortable for extended periods of exploring. Unlike other headsets, the ASUS Windows Mixed Reality Headset doesn’t need any external sensors, making initial set up super easy — you’ll be ready to play in 10 minutes or less*! It’s the revolutionary, easy-to-use and affordable way to explore your imagination.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 399,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,+ DisplayOrder = 1}- };- allProducts.Add(productAsusMixedReality);- productAsusMixedReality.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_asus_mixed_reality_1.png"), "image/png", pictureService.GetPictureSeName(productAsusMixedReality.Name), reference: Domain.Common.Reference.Product, objectId: productAsusMixedReality.Id)).Id,- DisplayOrder = 1,- });- productAsusMixedReality.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_asus_mixed_reality_2.png"), "image/png", pictureService.GetPictureSeName(productAsusMixedReality.Name), reference: Domain.Common.Reference.Product, objectId: productAsusMixedReality.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productAsusMixedReality);--- #endregion-- #region Display-- var productAcerProjector = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Acer Projector C250",- ShortDescription = "Auto-Portrait Technology Now the projector image can rotate automatically, just like on your phone!",- FullDescription = "<p>Auto-Portrait Technology Now the projector image can rotate automatically, just like on your phone! Equipped with Auto-Portrait technology, the C250i is the first model to be able to rotate the projected image in real time. There is no need to customize settings or content. Simply place the image vertically and the Acer C250i projector will remove intrusive black stripes by itself when you activate this mode. No stand, projecting from any angle The projector can be easily taken anywhere. The exclusive design does not take up much space and allows a 360-degree projection from any angle without using the stand. FHD Resolutions A beautiful 100-inch 1080p Full HD picture looks almost as realistic as the view from the window.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 530,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,- DisplayOrder = 3,- }+ }+ };+ allProducts.Add(productAsusMixedReality);+ productAsusMixedReality.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_asus_mixed_reality_1.png"), "image/png",+ pictureService.GetPictureSeName(productAsusMixedReality.Name), reference: Reference.Product,+ objectId: productAsusMixedReality.Id)).Id,+ DisplayOrder = 1+ });+ productAsusMixedReality.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_asus_mixed_reality_2.png"), "image/png",+ pictureService.GetPictureSeName(productAsusMixedReality.Name), reference: Reference.Product,+ objectId: productAsusMixedReality.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productAsusMixedReality);++ #endregion++ #region Display++ var productAcerProjector = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Acer Projector C250",+ ShortDescription =+ "Auto-Portrait Technology Now the projector image can rotate automatically, just like on your phone!",+ FullDescription =+ "<p>Auto-Portrait Technology Now the projector image can rotate automatically, just like on your phone! Equipped with Auto-Portrait technology, the C250i is the first model to be able to rotate the projected image in real time. There is no need to customize settings or content. Simply place the image vertically and the Acer C250i projector will remove intrusive black stripes by itself when you activate this mode. No stand, projecting from any angle The projector can be easily taken anywhere. The exclusive design does not take up much space and allows a 360-degree projection from any angle without using the stand. FHD Resolutions A beautiful 100-inch 1080p Full HD picture looks almost as realistic as the view from the window.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 530,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,+ DisplayOrder = 3}- };- allProducts.Add(productAcerProjector);- productAcerProjector.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_acer_projector_1.png"), "image/png", pictureService.GetPictureSeName(productAcerProjector.Name), reference: Domain.Common.Reference.Product, objectId: productAcerProjector.Id)).Id,- DisplayOrder = 1,- });- productAcerProjector.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_acer_projector_2.png"), "image/png", pictureService.GetPictureSeName(productAcerProjector.Name), reference: Domain.Common.Reference.Product, objectId: productAcerProjector.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productAcerProjector);--- var productAcerMonitor = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Acer Nitro XZ2",- ShortDescription = "Eliminate choppy gameplay and distracting visual tear with AMD Radeon FreeSync™1. Savor the smooth, responsive visuals as the monitor’s refresh rate is synched to your computer’s framerate.",- FullDescription = "<p>Eliminate choppy gameplay and distracting visual tear with AMD Radeon FreeSync™1. Savor the smooth, responsive visuals as the monitor’s refresh rate is synched to your computer’s framerate.</p><p>Enjoy seamless, lag-free gaming with a blazingly fast 165Hz2 refresh rate. To keep pace with the action, the rapid 4ms response time provides clearer, more immersive images.</p><p>Take your gameplay to the next level with improved color accuracy and contrast guaranteed by this VESA Certified DisplayHDR™ 400 monitor. This industry standard specifies HDR quality, including luminance, color gamut, bit depth, and rise time.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 1300,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,- DisplayOrder = 2,- }+ }+ };+ allProducts.Add(productAcerProjector);+ productAcerProjector.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_acer_projector_1.png"), "image/png",+ pictureService.GetPictureSeName(productAcerProjector.Name), reference: Reference.Product,+ objectId: productAcerProjector.Id)).Id,+ DisplayOrder = 1+ });+ productAcerProjector.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_acer_projector_2.png"), "image/png",+ pictureService.GetPictureSeName(productAcerProjector.Name), reference: Reference.Product,+ objectId: productAcerProjector.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productAcerProjector);+++ var productAcerMonitor = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Acer Nitro XZ2",+ ShortDescription =+ "Eliminate choppy gameplay and distracting visual tear with AMD Radeon FreeSync™1. Savor the smooth, responsive visuals as the monitor’s refresh rate is synched to your computer’s framerate.",+ FullDescription =+ "<p>Eliminate choppy gameplay and distracting visual tear with AMD Radeon FreeSync™1. Savor the smooth, responsive visuals as the monitor’s refresh rate is synched to your computer’s framerate.</p><p>Enjoy seamless, lag-free gaming with a blazingly fast 165Hz2 refresh rate. To keep pace with the action, the rapid 4ms response time provides clearer, more immersive images.</p><p>Take your gameplay to the next level with improved color accuracy and contrast guaranteed by this VESA Certified DisplayHDR™ 400 monitor. This industry standard specifies HDR quality, including luminance, color gamut, bit depth, and rise time.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 1300,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,+ DisplayOrder = 2}- };- allProducts.Add(productAcerMonitor);- productAcerMonitor.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_acer_monitor_1.png"), "image/png", pictureService.GetPictureSeName(productAcerMonitor.Name), reference: Domain.Common.Reference.Product, objectId: productAcerMonitor.Id)).Id,- DisplayOrder = 1,- });- productAcerMonitor.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_acer_monitor_2.png"), "image/png", pictureService.GetPictureSeName(productAcerMonitor.Name), reference: Domain.Common.Reference.Product, objectId: productAcerMonitor.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productAcerMonitor);-- #endregion-- #region Smartphone-- var productRedmiK30 = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Redmi K30 Ultra",- ShortDescription = "Redmi K30 Ultra will be equipped with top-class components. The smartphone is to debut on the market with a screen made in IPS LCD technology with a maximum refresh rate of 144 Hz, which guarantees smooth scrolling and perfect sharpness in movies and video games. It is worth noting that until now, displays of this type have been reserved exclusively for high-end gaming smartphones. The heart of the latest Redmi will be the MediaTek Dimensity 1000+ processor.",- FullDescription = "<p>Redmi K30 Ultra equipped with top-class components. The smartphone debut on the market with a screen made in IPS LCD technology with a maximum refresh rate of 144 Hz, which guarantees smooth scrolling and perfect sharpness in movies and video games. It is worth noting that until now, displays of this type have been reserved exclusively for high-end gaming smartphones. The heart of the latest Redmi will be the MediaTek Dimensity 1000+ processor. It is the collection's flagship chip offering eight cores, support for 5G connectivity and support for up to 16 GB RAM.</p>",- ProductLayoutId = productLayoutSimple.Id,- Flag = "New",- AllowCustomerReviews = true,- Price = 199,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ShowOnHomePage = true,- MarkAsNew = true,- BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productAcerMonitor);+ productAcerMonitor.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_acer_monitor_1.png"), "image/png",+ pictureService.GetPictureSeName(productAcerMonitor.Name), reference: Reference.Product,+ objectId: productAcerMonitor.Id)).Id,+ DisplayOrder = 1+ });+ productAcerMonitor.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_acer_monitor_2.png"), "image/png",+ pictureService.GetPictureSeName(productAcerMonitor.Name), reference: Reference.Product,+ objectId: productAcerMonitor.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productAcerMonitor);++ #endregion++ #region Smartphone++ var productRedmiK30 = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Redmi K30 Ultra",+ ShortDescription =+ "Redmi K30 Ultra will be equipped with top-class components. The smartphone is to debut on the market with a screen made in IPS LCD technology with a maximum refresh rate of 144 Hz, which guarantees smooth scrolling and perfect sharpness in movies and video games. It is worth noting that until now, displays of this type have been reserved exclusively for high-end gaming smartphones. The heart of the latest Redmi will be the MediaTek Dimensity 1000+ processor.",+ FullDescription =+ "<p>Redmi K30 Ultra equipped with top-class components. The smartphone debut on the market with a screen made in IPS LCD technology with a maximum refresh rate of 144 Hz, which guarantees smooth scrolling and perfect sharpness in movies and video games. It is worth noting that until now, displays of this type have been reserved exclusively for high-end gaming smartphones. The heart of the latest Redmi will be the MediaTek Dimensity 1000+ processor. It is the collection's flagship chip offering eight cores, support for 5G connectivity and support for up to 16 GB RAM.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ Flag = "New",+ AllowCustomerReviews = true,+ Price = 199,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ShowOnHomePage = true,+ MarkAsNew = true,+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,+ DisplayOrder = 1}- };- allProducts.Add(productRedmiK30);- productRedmiK30.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Redmi_K30.png"), "image/png", pictureService.GetPictureSeName(productRedmiK30.Name), reference: Domain.Common.Reference.Product, objectId: productRedmiK30.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productRedmiK30);--- var productRedmiNote9 = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Redmi Note 9",- ShortDescription = "Redmi Note 9 is equipped with a high-performance octa-core processor with a maximum clock frequency of 2.0 GHz. The maximum GPU frequency of 1.0GHz ensures better performance and thus offers a smooth gaming experience.",- FullDescription = "<p>Redmi Note 9 is equipped with a high-performance octa-core processor with a maximum clock frequency of 2.0 GHz. The maximum GPU frequency of 1.0GHz ensures better performance and thus offers a smooth gaming experience.</p><p>Thanks to the improved 5020mAh battery, you can enjoy long work on a single charge. In combination with the 18W fast charge, you will get excellent results and charge the battery in no time.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 249,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productRedmiK30);+ productRedmiK30.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_Redmi_K30.png"), "image/png",+ pictureService.GetPictureSeName(productRedmiK30.Name), reference: Reference.Product,+ objectId: productRedmiK30.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productRedmiK30);+++ var productRedmiNote9 = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Redmi Note 9",+ ShortDescription =+ "Redmi Note 9 is equipped with a high-performance octa-core processor with a maximum clock frequency of 2.0 GHz. The maximum GPU frequency of 1.0GHz ensures better performance and thus offers a smooth gaming experience.",+ FullDescription =+ "<p>Redmi Note 9 is equipped with a high-performance octa-core processor with a maximum clock frequency of 2.0 GHz. The maximum GPU frequency of 1.0GHz ensures better performance and thus offers a smooth gaming experience.</p><p>Thanks to the improved 5020mAh battery, you can enjoy long work on a single charge. In combination with the 18W fast charge, you will get excellent results and charge the battery in no time.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 249,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,+ DisplayOrder = 1}- };- allProducts.Add(productRedmiNote9);- productRedmiNote9.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Redmi_Note_9_1.png"), "image/png", pictureService.GetPictureSeName(productRedmiNote9.Name), reference: Domain.Common.Reference.Product, objectId: productRedmiNote9.Id)).Id,- DisplayOrder = 1,- });- productRedmiNote9.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Redmi_Note_9_2.png"), "image/png", pictureService.GetPictureSeName(productRedmiNote9.Name), reference: Domain.Common.Reference.Product, objectId: productRedmiNote9.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productRedmiNote9);--- var productPocoF2Pro = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "POCO F2 Pro",- ShortDescription = "The speed demon is now even better. Powered by an octa-core trifecta processor with a liquid cooling system, it provides a perfect working experience. Quad Camera with Pro Mode support.",- FullDescription = "<p>The speed demon is now even better. Powered by an octa-core trifecta processor with a liquid cooling system, it provides a perfect working experience. Quad Camera with Pro Mode support.</p><p>The technology of execution in 7nm provides a 25% increase in performance, improving the smoothness of graphics rendering, while significantly reducing energy consumption. Kryo 585 ™ processor | Adreno 650 ™ graphics processor</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 299,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productRedmiNote9);+ productRedmiNote9.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_Redmi_Note_9_1.png"), "image/png",+ pictureService.GetPictureSeName(productRedmiNote9.Name), reference: Reference.Product,+ objectId: productRedmiNote9.Id)).Id,+ DisplayOrder = 1+ });+ productRedmiNote9.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_Redmi_Note_9_2.png"), "image/png",+ pictureService.GetPictureSeName(productRedmiNote9.Name), reference: Reference.Product,+ objectId: productRedmiNote9.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productRedmiNote9);+++ var productPocoF2Pro = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "POCO F2 Pro",+ ShortDescription =+ "The speed demon is now even better. Powered by an octa-core trifecta processor with a liquid cooling system, it provides a perfect working experience. Quad Camera with Pro Mode support.",+ FullDescription =+ "<p>The speed demon is now even better. Powered by an octa-core trifecta processor with a liquid cooling system, it provides a perfect working experience. Quad Camera with Pro Mode support.</p><p>The technology of execution in 7nm provides a 25% increase in performance, improving the smoothness of graphics rendering, while significantly reducing energy consumption. Kryo 585 ™ processor | Adreno 650 ™ graphics processor</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 299,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,+ DisplayOrder = 1}- };- allProducts.Add(productPocoF2Pro);- productPocoF2Pro.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_POCO_F2_Pro.png"), "image/png", pictureService.GetPictureSeName(productPocoF2Pro.Name), reference: Domain.Common.Reference.Product, objectId: productPocoF2Pro.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productPocoF2Pro);--- #endregion-- #region Others---- var productMiSmartBand = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Mi Smart Band 3i",- ShortDescription = "<b>Mi Smart Band 3i:</b> Ignite your fitness journey with water resistant smart watch. Intuitive and Easy to View with large 0.78 inch OLED touch display. Get moving with the Fit App. Activity tracker and sleep tracker included.",- FullDescription = "<p><b>Mi Smart Band 3i:</b> Ignite your fitness journey with water resistant smart watch. Intuitive and Easy to View with large 0.78 inch OLED touch display. Get moving with the Fit App. Activity tracker and sleep tracker included.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 79.99,- IsShipEnabled = true,- IsFreeShipping = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- MarkAsNew = true,- BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,- TierPrices =- {- new TierPrice- {- Quantity = 2,- Price = 19,- StartDateTimeUtc = DateTime.UtcNow,- EndDateTimeUtc = null- },- new TierPrice- {- Quantity = 5,- Price = 17,- },- new TierPrice- {- Quantity = 10,- Price = 15,- }+ }+ };+ allProducts.Add(productPocoF2Pro);+ productPocoF2Pro.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_POCO_F2_Pro.png"), "image/png",+ pictureService.GetPictureSeName(productPocoF2Pro.Name), reference: Reference.Product,+ objectId: productPocoF2Pro.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productPocoF2Pro);++ #endregion++ #region Others++ var productMiSmartBand = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Mi Smart Band 3i",+ ShortDescription =+ "<b>Mi Smart Band 3i:</b> Ignite your fitness journey with water resistant smart watch. Intuitive and Easy to View with large 0.78 inch OLED touch display. Get moving with the Fit App. Activity tracker and sleep tracker included.",+ FullDescription =+ "<p><b>Mi Smart Band 3i:</b> Ignite your fitness journey with water resistant smart watch. Intuitive and Easy to View with large 0.78 inch OLED touch display. Get moving with the Fit App. Activity tracker and sleep tracker included.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 79.99,+ IsShipEnabled = true,+ IsFreeShipping = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ MarkAsNew = true,+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,+ TierPrices = {+ new TierPrice {+ Quantity = 2,+ Price = 19,+ StartDateTimeUtc = DateTime.UtcNow,+ EndDateTimeUtc = null},- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,- DisplayOrder = 1,- }+ new TierPrice {+ Quantity = 5,+ Price = 17+ },+ new TierPrice {+ Quantity = 10,+ Price = 15}- };- allProducts.Add(productMiSmartBand);- productMiSmartBand.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Mi_Smart_Band_3i_1.png"), "image/png", pictureService.GetPictureSeName(productMiSmartBand.Name), reference: Domain.Common.Reference.Product, objectId: productMiSmartBand.Id)).Id,- DisplayOrder = 1,- });- productMiSmartBand.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_Mi_Smart_Band_3i_2.png"), "image/png", pictureService.GetPictureSeName(productMiSmartBand.Name), reference: Domain.Common.Reference.Product, objectId: productMiSmartBand.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productMiSmartBand);--- var productPs4 = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Playstation 4 Slim",- ShortDescription = "Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4™.",- FullDescription = "<p>Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4 ™.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 39,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,- DisplayOrder = 1,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,+ DisplayOrder = 1}- };- allProducts.Add(productPs4);- productPs4.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps4_1.png"), "image/png", pictureService.GetPictureSeName(productPs4.Name), reference: Domain.Common.Reference.Product, objectId: productPs4.Id)).Id,- DisplayOrder = 1,- });- productPs4.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps4_2.png"), "image/png", pictureService.GetPictureSeName(productPs4.Name), reference: Domain.Common.Reference.Product, objectId: productPs4.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productPs4);--- var productMiBeard = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Xiaomi Mi Beard",- ShortDescription = "Rounded blades for skin - friendly performance. Advanced self - sharpening. When in a rush, simply plug in the cord and get trimming. IPX7 fully-washable body The whole body is hydro - resistant and fully washable for your convenience.Comes with detachable head.",- FullDescription = "<p>Rounded blades for skin - friendly performance. Advanced self - sharpening. With 2 combs that can go between 0.5mm and 20mm, this trimmer will perfectly sculpt your beard.Precision is at its finest with 6000 oscillations per min delivering accurate cuts and even shape.</p><p>IPX7 fully-washable body The whole body is hydro - resistant and fully washable for your convenience.Comes with detachable head.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 37,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productMiSmartBand);+ productMiSmartBand.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_Mi_Smart_Band_3i_1.png"), "image/png",+ pictureService.GetPictureSeName(productMiSmartBand.Name), reference: Reference.Product,+ objectId: productMiSmartBand.Id)).Id,+ DisplayOrder = 1+ });+ productMiSmartBand.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_Mi_Smart_Band_3i_2.png"), "image/png",+ pictureService.GetPictureSeName(productMiSmartBand.Name), reference: Reference.Product,+ objectId: productMiSmartBand.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productMiSmartBand);+++ var productPs4 = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Playstation 4 Slim",+ ShortDescription =+ "Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4™.",+ FullDescription =+ "<p>Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4 ™.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 39,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,+ DisplayOrder = 1}- };- allProducts.Add(productMiBeard);- productMiBeard.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_mi_beard_1.png"), "image/png", pictureService.GetPictureSeName(productMiBeard.Name), reference: Domain.Common.Reference.Product, objectId: productMiBeard.Id)).Id,- DisplayOrder = 1,- });- productMiBeard.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_mi_beard_2.png"), "image/png", pictureService.GetPictureSeName(productMiBeard.Name), reference: Domain.Common.Reference.Product, objectId: productMiBeard.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productMiBeard);--- #endregion-- #region Shoes--- var productAdidasPredator = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "adidas Predator Instinct",- ShortDescription = "Adidas Predator is the highest quality model of football boots. The special construction of the sole guarantees high flexibility and great adhesion, and the ingredients used to make the upper (synthetic material) ensure optimal weight of the shoe and adequate protection throughout the year.",- FullDescription = "<p>Adidas Predator is the highest quality model of football boots. The special construction of the sole guarantees high flexibility and great adhesion, and the ingredients used to make the upper (synthetic material) ensure optimal weight of the shoe and adequate protection throughout the year. A feature of this model is also excellent vapor permeability - the moisture generated during the game is effectively expelled to the outside. The unique comfort and excellent foot support are due to the modern construction elements used by Adidas, which improve the player's features on the pitch. In Adidas footwear, the footballer turns into a ruthless predator. Thanks to the combination of modern technologies and great design, it is an excellent choice and fun to play.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 149,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductAttributeMappings =- {- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,- AttributeControlTypeId = AttributeControlType.DropdownList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "8",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "9",- DisplayOrder = 2,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "10",- DisplayOrder = 3,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "11",- DisplayOrder = 4,- }- }- },- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Color").Id,- AttributeControlTypeId = AttributeControlType.DropdownList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "White/Blue",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "White/Black",- DisplayOrder = 2,- },+ }+ };+ allProducts.Add(productPs4);+ productPs4.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps4_1.png"),+ "image/png", pictureService.GetPictureSeName(productPs4.Name), reference: Reference.Product,+ objectId: productPs4.Id)).Id,+ DisplayOrder = 1+ });+ productPs4.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps4_2.png"),+ "image/png", pictureService.GetPictureSeName(productPs4.Name), reference: Reference.Product,+ objectId: productPs4.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productPs4);+++ var productMiBeard = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Xiaomi Mi Beard",+ ShortDescription =+ "Rounded blades for skin - friendly performance. Advanced self - sharpening. When in a rush, simply plug in the cord and get trimming. IPX7 fully-washable body The whole body is hydro - resistant and fully washable for your convenience.Comes with detachable head.",+ FullDescription =+ "<p>Rounded blades for skin - friendly performance. Advanced self - sharpening. With 2 combs that can go between 0.5mm and 20mm, this trimmer will perfectly sculpt your beard.Precision is at its finest with 6000 oscillations per min delivering accurate cuts and even shape.</p><p>IPX7 fully-washable body The whole body is hydro - resistant and fully washable for your convenience.Comes with detachable head.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 37,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productMiBeard);+ productMiBeard.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_mi_beard_1.png"), "image/png",+ pictureService.GetPictureSeName(productMiBeard.Name), reference: Reference.Product,+ objectId: productMiBeard.Id)).Id,+ DisplayOrder = 1+ });+ productMiBeard.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_mi_beard_2.png"), "image/png",+ pictureService.GetPictureSeName(productMiBeard.Name), reference: Reference.Product,+ objectId: productMiBeard.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productMiBeard);++ #endregion++ #region Shoes++ var productAdidasPredator = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "adidas Predator Instinct",+ ShortDescription =+ "Adidas Predator is the highest quality model of football boots. The special construction of the sole guarantees high flexibility and great adhesion, and the ingredients used to make the upper (synthetic material) ensure optimal weight of the shoe and adequate protection throughout the year.",+ FullDescription =+ "<p>Adidas Predator is the highest quality model of football boots. The special construction of the sole guarantees high flexibility and great adhesion, and the ingredients used to make the upper (synthetic material) ensure optimal weight of the shoe and adequate protection throughout the year. A feature of this model is also excellent vapor permeability - the moisture generated during the game is effectively expelled to the outside. The unique comfort and excellent foot support are due to the modern construction elements used by Adidas, which improve the player's features on the pitch. In Adidas footwear, the footballer turns into a ruthless predator. Thanks to the combination of modern technologies and great design, it is an excellent choice and fun to play.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 149,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductAttributeMappings = {+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "8",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "9",+ DisplayOrder = 2+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "10",+ DisplayOrder = 3+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "11",+ DisplayOrder = 4}}},- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,- DisplayOrder = 1,- }- },- BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id,- };- allProducts.Add(productAdidasPredator);- productAdidasPredator.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_predator_1.png"), "image/png", pictureService.GetPictureSeName(productAdidasPredator.Name), reference: Domain.Common.Reference.Product, objectId: productAdidasPredator.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productAdidasPredator);--- var productAdidasNitrocharge = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Adidas Nitrocharge",- ShortDescription = "The shoes are made of synthetic materials, they fit well to the foot thanks to their anatomical design and the insole made of Eva material. They are designed for playing and running on natural surfaces.",- FullDescription = "<p>One of three colorways of the adidas Consortium Campus 80s Primeknit set to drop alongside each other. This pair comes in light maroon and running white. Featuring a maroon-based primeknit upper with white accents. A limited release, look out for these at select adidas Consortium accounts worldwide.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 99,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductAttributeMappings =- {- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,- AttributeControlTypeId = AttributeControlType.DropdownList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "8",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "9",- DisplayOrder = 2,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "10",- DisplayOrder = 3,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "11",- DisplayOrder = 4,- }+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Color").Id,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "White/Blue",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "White/Black",+ DisplayOrder = 2}- },- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Color").Id,- AttributeControlTypeId = AttributeControlType.ColorSquares,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Yellow",- IsPreSelected = true,- ColorSquaresRgb = "#FFFF00",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Blue",- ColorSquaresRgb = "#363656",- DisplayOrder = 2,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Orange",- ColorSquaresRgb = "#FF8000",- DisplayOrder = 3,- }- }- }- },- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,- DisplayOrder = 1,}- },- BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id,- };- allProducts.Add(productAdidasNitrocharge);- productAdidasNitrocharge.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas.png"), "image/png", pictureService.GetPictureSeName(productAdidasNitrocharge.Name), reference: Domain.Common.Reference.Product, objectId: productAdidasNitrocharge.Id)).Id,- DisplayOrder = 1,- });- productAdidasNitrocharge.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas_2.png"), "image/png", pictureService.GetPictureSeName(productAdidasNitrocharge.Name), reference: Domain.Common.Reference.Product, objectId: productAdidasNitrocharge.Id)).Id,- DisplayOrder = 2,- });- productAdidasNitrocharge.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas_3.png"), "image/png", pictureService.GetPictureSeName(productAdidasNitrocharge.Name), reference: Domain.Common.Reference.Product, objectId: productAdidasNitrocharge.Id)).Id,- DisplayOrder = 3,- });- productAdidasNitrocharge.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas_4.png"), "image/png", pictureService.GetPictureSeName(productAdidasNitrocharge.Name), reference: Domain.Common.Reference.Product, objectId: productAdidasNitrocharge.Id)).Id,- DisplayOrder = 4,- });--- await _productRepository.InsertAsync(productAdidasNitrocharge);-- var productAttribute = _productAttributeRepository.Table.Where(x => x.Name == "Color").FirstOrDefault();-- productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id).First().ProductAttributeValues.Where(x => x.Name == "Blue").First().PictureId = productAdidasNitrocharge.ProductPictures.ElementAt(1).PictureId;- productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id).First().ProductAttributeValues.Where(x => x.Name == "Yellow").First().PictureId = productAdidasNitrocharge.ProductPictures.ElementAt(2).PictureId;- productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id).First().ProductAttributeValues.Where(x => x.Name == "Orange").First().PictureId = productAdidasNitrocharge.ProductPictures.ElementAt(3).PictureId;- await _productRepository.UpdateAsync(productAdidasNitrocharge);--- var productAdidasTurfs = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Adidas Turfs",- ShortDescription = "Be unpredictable. Shoes designed for the youngest players starting their adventure with football. The sole is designed to provide perfect grip on artificial turf and hard or frozen surfaces.",- FullDescription = "Be unpredictable. Shoes designed for the youngest players starting their adventure with football. The sole is designed to provide perfect grip on artificial turf and hard or frozen surfaces. The X-SKIN INSPIRATION upper made of synthetic material will give a feeling of lightness and support while guiding the ball thanks to the convex texture. The heel stiffening will provide stability, and the textile inner lining will provide comfort and adequate cushioning. A profiled insole reflecting the anatomical shape of the foot and symmetrical lacing will keep the foot in the right position. The sole will allow for dynamic feints and changes in the direction of the run on artificial turf as well as hard or frozen surfaces.",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 89,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,- DisplayOrder = 1,+ }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,+ DisplayOrder = 1+ }+ },+ BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id+ };+ allProducts.Add(productAdidasPredator);+ productAdidasPredator.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_predator_1.png"), "image/png",+ pictureService.GetPictureSeName(productAdidasPredator.Name), reference: Reference.Product,+ objectId: productAdidasPredator.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productAdidasPredator);+++ var productAdidasNitrocharge = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Adidas Nitrocharge",+ ShortDescription =+ "The shoes are made of synthetic materials, they fit well to the foot thanks to their anatomical design and the insole made of Eva material. They are designed for playing and running on natural surfaces.",+ FullDescription =+ "<p>One of three colorways of the adidas Consortium Campus 80s Primeknit set to drop alongside each other. This pair comes in light maroon and running white. Featuring a maroon-based primeknit upper with white accents. A limited release, look out for these at select adidas Consortium accounts worldwide.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 99,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductAttributeMappings = {+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "8",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "9",+ DisplayOrder = 2+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "10",+ DisplayOrder = 3+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "11",+ DisplayOrder = 4+ }}},- BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id,- };- allProducts.Add(productAdidasTurfs);- productAdidasTurfs.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidasturfs.png"), "image/png", pictureService.GetPictureSeName(productAdidasTurfs.Name), reference: Domain.Common.Reference.Product, objectId: productAdidasTurfs.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productAdidasTurfs);--- #endregion-- #region Apparel-- //this one is a grouped product with two associated ones- var productDerbyKit = new Product- {- ProductTypeId = ProductType.GroupedProduct,- VisibleIndividually = true,- Name = "Derby County Kit",- ShortDescription = "Show your pride and support and show off in The Rams Homemade Costumes.",- FullDescription = "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",- ProductLayoutId = productLayoutGrouped.Id,- AllowCustomerReviews = true,- Published = true,- Price = 129.99,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Color").Id,+ AttributeControlTypeId = AttributeControlType.ColorSquares,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Yellow",+ IsPreSelected = true,+ ColorSquaresRgb = "#FFFF00",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Blue",+ ColorSquaresRgb = "#363656",+ DisplayOrder = 2+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Orange",+ ColorSquaresRgb = "#FF8000",+ DisplayOrder = 3+ }}}- };- allProducts.Add(productDerbyKit);- productDerbyKit.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_derby_awayshirt_1.png"), "image/png", pictureService.GetPictureSeName(productDerbyKit.Name), reference: Domain.Common.Reference.Product, objectId: productDerbyKit.Id)).Id,- DisplayOrder = 1,- });- productDerbyKit.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png", pictureService.GetPictureSeName(productDerbyKit.Name), reference: Domain.Common.Reference.Product, objectId: productDerbyKit.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productDerbyKit);- var productDerbyKit_associated_1 = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = false, //hide this products- ParentGroupedProductId = productDerbyKit.Id,- Name = "Derby County Shirt - Away",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Published = true,- Price = 129.99,- IsShipEnabled = true,- Flag = "Grouped",- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,+ DisplayOrder = 1}- };- allProducts.Add(productDerbyKit_associated_1);- productDerbyKit_associated_1.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_derby_awayshirt_1.png"), "image/png", pictureService.GetPictureSeName("Derby County Away Shirt"), reference: Domain.Common.Reference.Product, objectId: productDerbyKit_associated_1.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productDerbyKit_associated_1);- var productDerbyKit_associated_2 = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = false,- ParentGroupedProductId = productDerbyKit.Id,- Name = "Derby County Shirt - Home",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Published = true,- Price = 149.99,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }+ },+ BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id+ };+ allProducts.Add(productAdidasNitrocharge);+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas.png"),+ "image/png", pictureService.GetPictureSeName(productAdidasNitrocharge.Name),+ reference: Reference.Product, objectId: productAdidasNitrocharge.Id)).Id,+ DisplayOrder = 1+ });+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_adidas_2.png"), "image/png",+ pictureService.GetPictureSeName(productAdidasNitrocharge.Name), reference: Reference.Product,+ objectId: productAdidasNitrocharge.Id)).Id,+ DisplayOrder = 2+ });+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_adidas_3.png"), "image/png",+ pictureService.GetPictureSeName(productAdidasNitrocharge.Name), reference: Reference.Product,+ objectId: productAdidasNitrocharge.Id)).Id,+ DisplayOrder = 3+ });+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_adidas_4.png"), "image/png",+ pictureService.GetPictureSeName(productAdidasNitrocharge.Name), reference: Reference.Product,+ objectId: productAdidasNitrocharge.Id)).Id,+ DisplayOrder = 4+ });+++ await _productRepository.InsertAsync(productAdidasNitrocharge);++ var productAttribute = _productAttributeRepository.Table.Where(x => x.Name == "Color").FirstOrDefault();++ productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id)+ .First().ProductAttributeValues.Where(x => x.Name == "Blue").First().PictureId =+ productAdidasNitrocharge.ProductPictures.ElementAt(1).PictureId;+ productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id)+ .First().ProductAttributeValues.Where(x => x.Name == "Yellow").First().PictureId =+ productAdidasNitrocharge.ProductPictures.ElementAt(2).PictureId;+ productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id)+ .First().ProductAttributeValues.Where(x => x.Name == "Orange").First().PictureId =+ productAdidasNitrocharge.ProductPictures.ElementAt(3).PictureId;+ await _productRepository.UpdateAsync(productAdidasNitrocharge);+++ var productAdidasTurfs = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Adidas Turfs",+ ShortDescription =+ "Be unpredictable. Shoes designed for the youngest players starting their adventure with football. The sole is designed to provide perfect grip on artificial turf and hard or frozen surfaces.",+ FullDescription =+ "Be unpredictable. Shoes designed for the youngest players starting their adventure with football. The sole is designed to provide perfect grip on artificial turf and hard or frozen surfaces. The X-SKIN INSPIRATION upper made of synthetic material will give a feeling of lightness and support while guiding the ball thanks to the convex texture. The heel stiffening will provide stability, and the textile inner lining will provide comfort and adequate cushioning. A profiled insole reflecting the anatomical shape of the foot and symmetrical lacing will keep the foot in the right position. The sole will allow for dynamic feints and changes in the direction of the run on artificial turf as well as hard or frozen surfaces.",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 89,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,+ DisplayOrder = 1}- };- allProducts.Add(productDerbyKit_associated_2);- productDerbyKit_associated_2.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png", pictureService.GetPictureSeName("Derby County Shirt - Home"), reference: Domain.Common.Reference.Product, objectId: productDerbyKit_associated_2.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productDerbyKit_associated_2);-- var productNikeKids = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Nike Kids Kit",- ShortDescription = "Nike Dry-FIT football kit for kids. The set includes a T-shirt, shorts and football socks. Clothes made of high-quality synthetic materials that perfectly transport moisture and dry quickly.",- FullDescription = "<p>Nike Dry-FIT football kit for kids. The set includes a T-shirt, shorts and football socks. Clothes made of high-quality synthetic materials that perfectly transport moisture and dry quickly. The set is perfect for training, matches, PE lessons, and the T-shirt and shorts are also perfect for everyday use. The shirt has ventilation panels under the arms and the back is made of airy mesh that removes excess heat. Children's shorts with an elastic, rubber belt will adapt to any figure. The set also includes football socks made of a pleasant-to-touch material that ensures high comfort of use.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Published = true,- Price = 39,- IsShipEnabled = true,- Weight = 1,- Length = 2,- Width = 3,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- ProductAttributeMappings =- {- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,- AttributeControlTypeId = AttributeControlType.DropdownList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Small",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "1X",- DisplayOrder = 2,- },-- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "2X",- DisplayOrder = 3,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "3X",- DisplayOrder = 4,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "4X",- DisplayOrder = 5,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "5X",- DisplayOrder = 6,- }+ },+ BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id+ };+ allProducts.Add(productAdidasTurfs);+ productAdidasTurfs.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_adidasturfs.png"), "image/png",+ pictureService.GetPictureSeName(productAdidasTurfs.Name), reference: Reference.Product,+ objectId: productAdidasTurfs.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productAdidasTurfs);++ #endregion++ #region Apparel++ //this one is a grouped product with two associated ones+ var productDerbyKit = new Product {+ ProductTypeId = ProductType.GroupedProduct,+ VisibleIndividually = true,+ Name = "Derby County Kit",+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Costumes.",+ FullDescription =+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",+ ProductLayoutId = productLayoutGrouped.Id,+ AllowCustomerReviews = true,+ Published = true,+ Price = 129.99,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productDerbyKit);+ productDerbyKit.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_derby_awayshirt_1.png"), "image/png",+ pictureService.GetPictureSeName(productDerbyKit.Name), reference: Reference.Product,+ objectId: productDerbyKit.Id)).Id,+ DisplayOrder = 1+ });+ productDerbyKit.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",+ pictureService.GetPictureSeName(productDerbyKit.Name), reference: Reference.Product,+ objectId: productDerbyKit.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productDerbyKit);+ var productDerbyKit_associated_1 = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = false, //hide this products+ ParentGroupedProductId = productDerbyKit.Id,+ Name = "Derby County Shirt - Away",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Published = true,+ Price = 129.99,+ IsShipEnabled = true,+ Flag = "Grouped",+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productDerbyKit_associated_1);+ productDerbyKit_associated_1.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_derby_awayshirt_1.png"), "image/png",+ pictureService.GetPictureSeName("Derby County Away Shirt"), reference: Reference.Product,+ objectId: productDerbyKit_associated_1.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productDerbyKit_associated_1);+ var productDerbyKit_associated_2 = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = false,+ ParentGroupedProductId = productDerbyKit.Id,+ Name = "Derby County Shirt - Home",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Published = true,+ Price = 149.99,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productDerbyKit_associated_2);+ productDerbyKit_associated_2.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",+ pictureService.GetPictureSeName("Derby County Shirt - Home"), reference: Reference.Product,+ objectId: productDerbyKit_associated_2.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productDerbyKit_associated_2);++ var productNikeKids = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Nike Kids Kit",+ ShortDescription =+ "Nike Dry-FIT football kit for kids. The set includes a T-shirt, shorts and football socks. Clothes made of high-quality synthetic materials that perfectly transport moisture and dry quickly.",+ FullDescription =+ "<p>Nike Dry-FIT football kit for kids. The set includes a T-shirt, shorts and football socks. Clothes made of high-quality synthetic materials that perfectly transport moisture and dry quickly. The set is perfect for training, matches, PE lessons, and the T-shirt and shorts are also perfect for everyday use. The shirt has ventilation panels under the arms and the back is made of airy mesh that removes excess heat. Children's shorts with an elastic, rubber belt will adapt to any figure. The set also includes football socks made of a pleasant-to-touch material that ensures high comfort of use.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Published = true,+ Price = 39,+ IsShipEnabled = true,+ Weight = 1,+ Length = 2,+ Width = 3,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ ProductAttributeMappings = {+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Small",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "1X",+ DisplayOrder = 2+ },++ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "2X",+ DisplayOrder = 3+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "3X",+ DisplayOrder = 4+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "4X",+ DisplayOrder = 5+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "5X",+ DisplayOrder = 6}}- },- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }}- };- allProducts.Add(productNikeKids);- productNikeKids.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_kidskit.png"), "image/png", pictureService.GetPictureSeName(productNikeKids.Name), reference: Domain.Common.Reference.Product, objectId: productNikeKids.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productNikeKids);-- var productPsgKit = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Paris Saint Germain Home Kit",- ShortDescription = "",- FullDescription = "<p>This oversized women t-Shirt needs minimum ironing. It is a great product at a great value!</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 99.99,- IsShipEnabled = true,- Weight = 4,- Length = 3,- Width = 3,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- TierPrices =- {- new TierPrice- {- Quantity = 3,- Price = 21,- },- new TierPrice- {- Quantity = 7,- Price = 19,- },- new TierPrice- {- Quantity = 10,- Price = 16,- }- },- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1}- };- allProducts.Add(productPsgKit);- productPsgKit.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_psg_1.png"), "image/png", pictureService.GetPictureSeName(productPsgKit.Name), reference: Domain.Common.Reference.Product, objectId: productPsgKit.Id)).Id,- DisplayOrder = 1,- });- productPsgKit.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_psg_2.png"), "image/png", pictureService.GetPictureSeName(productPsgKit.Name), reference: Domain.Common.Reference.Product, objectId: productPsgKit.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productPsgKit);--- var productDerbyShirt = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Derby County Home Shirt",- ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",- FullDescription = "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 59,- IsShipEnabled = true,- Weight = 4,- Length = 3,- Width = 3,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductAttributeMappings =- {- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Custom Text").Id,- TextPrompt = "Enter your text:",- AttributeControlTypeId = AttributeControlType.TextBox,- IsRequired = true,- }+ }+ };+ allProducts.Add(productNikeKids);+ productNikeKids.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_kidskit.png"),+ "image/png", pictureService.GetPictureSeName(productNikeKids.Name), reference: Reference.Product,+ objectId: productNikeKids.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productNikeKids);++ var productPsgKit = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Paris Saint Germain Home Kit",+ ShortDescription = "",+ FullDescription =+ "<p>This oversized women t-Shirt needs minimum ironing. It is a great product at a great value!</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 99.99,+ IsShipEnabled = true,+ Weight = 4,+ Length = 3,+ Width = 3,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ TierPrices = {+ new TierPrice {+ Quantity = 3,+ Price = 21},- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }+ new TierPrice {+ Quantity = 7,+ Price = 19+ },+ new TierPrice {+ Quantity = 10,+ Price = 16}- };- allProducts.Add(productDerbyShirt);- productDerbyShirt.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png", pictureService.GetPictureSeName(productDerbyShirt.Name), reference: Domain.Common.Reference.Product, objectId: productDerbyShirt.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productDerbyShirt);-- var productDerbyShorts = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Derby County Home Shorts",- ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",- FullDescription = "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 29,- IsShipEnabled = true,- Weight = 4,- Length = 3,- Width = 3,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1}- };- allProducts.Add(productDerbyShorts);- productDerbyShorts.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_derby_shorts_1.png"), "image/png", pictureService.GetPictureSeName(productDerbyShorts.Name), reference: Domain.Common.Reference.Product, objectId: productDerbyShorts.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productDerbyShorts);-- var productDerbyKitHome = new Product- {- ProductTypeId = ProductType.BundledProduct,- VisibleIndividually = true,- Name = "Derby County Home Shirt",- ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",- FullDescription = "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 15,- IsShipEnabled = true,- Weight = 4,- Length = 3,- Width = 3,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productPsgKit);+ productPsgKit.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_psg_1.png"),+ "image/png", pictureService.GetPictureSeName(productPsgKit.Name), reference: Reference.Product,+ objectId: productPsgKit.Id)).Id,+ DisplayOrder = 1+ });+ productPsgKit.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_psg_2.png"),+ "image/png", pictureService.GetPictureSeName(productPsgKit.Name), reference: Reference.Product,+ objectId: productPsgKit.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productPsgKit);+++ var productDerbyShirt = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Derby County Home Shirt",+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",+ FullDescription =+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 59,+ IsShipEnabled = true,+ Weight = 4,+ Length = 3,+ Width = 3,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductAttributeMappings = {+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Custom Text").Id,+ TextPrompt = "Enter your text:",+ AttributeControlTypeId = AttributeControlType.TextBox,+ IsRequired = true}- };- allProducts.Add(productDerbyKitHome);- productDerbyKitHome.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png", pictureService.GetPictureSeName(productDerbyKitHome.Name), reference: Domain.Common.Reference.Product, objectId: productDerbyKitHome.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productDerbyKitHome);-- var productChicagoBulls = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Chicago Bulls Jersey",- ShortDescription = "Capture your team's distinct identity when you grab this custom Chicago Bulls jersey, It features classic trims and Chicago Bulls graphics along with Nike Dry and Dri-FIT technologies for added comfort.",- FullDescription = "<p>Capture your team's distinct identity when you grab this custom Chicago Bulls jersey, It features classic trims and Chicago Bulls graphics along with Nike Dry and Dri-FIT technologies for added comfort. Before you watch the next game, grab this incredible jersey so everyone knows your fandom is on the cutting edge.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 43.5,- OldPrice = 55,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- TierPrices =- {- new TierPrice- {- Quantity = 3,- Price = 40,- },- new TierPrice- {- Quantity = 6,- Price = 38,- },- new TierPrice- {- Quantity = 10,- Price = 35,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productDerbyShirt);+ productDerbyShirt.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",+ pictureService.GetPictureSeName(productDerbyShirt.Name), reference: Reference.Product,+ objectId: productDerbyShirt.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productDerbyShirt);++ var productDerbyShorts = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Derby County Home Shorts",+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",+ FullDescription =+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 29,+ IsShipEnabled = true,+ Weight = 4,+ Length = 3,+ Width = 3,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productDerbyShorts);+ productDerbyShorts.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_derby_shorts_1.png"), "image/png",+ pictureService.GetPictureSeName(productDerbyShorts.Name), reference: Reference.Product,+ objectId: productDerbyShorts.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productDerbyShorts);++ var productDerbyKitHome = new Product {+ ProductTypeId = ProductType.BundledProduct,+ VisibleIndividually = true,+ Name = "Derby County Home Shirt",+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",+ FullDescription =+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 15,+ IsShipEnabled = true,+ Weight = 4,+ Length = 3,+ Width = 3,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productDerbyKitHome);+ productDerbyKitHome.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",+ pictureService.GetPictureSeName(productDerbyKitHome.Name), reference: Reference.Product,+ objectId: productDerbyKitHome.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productDerbyKitHome);++ var productChicagoBulls = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Chicago Bulls Jersey",+ ShortDescription =+ "Capture your team's distinct identity when you grab this custom Chicago Bulls jersey, It features classic trims and Chicago Bulls graphics along with Nike Dry and Dri-FIT technologies for added comfort.",+ FullDescription =+ "<p>Capture your team's distinct identity when you grab this custom Chicago Bulls jersey, It features classic trims and Chicago Bulls graphics along with Nike Dry and Dri-FIT technologies for added comfort. Before you watch the next game, grab this incredible jersey so everyone knows your fandom is on the cutting edge.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 43.5,+ OldPrice = 55,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ TierPrices = {+ new TierPrice {+ Quantity = 3,+ Price = 40},- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,- DisplayOrder = 1,- }+ new TierPrice {+ Quantity = 6,+ Price = 38+ },+ new TierPrice {+ Quantity = 10,+ Price = 35}- };- allProducts.Add(productChicagoBulls);-- productChicagoBulls.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_chicago_jersey_1.png"), "image/png", pictureService.GetPictureSeName(productChicagoBulls.Name), reference: Domain.Common.Reference.Product, objectId: productChicagoBulls.Id)).Id,- DisplayOrder = 1,- });- productChicagoBulls.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_chicago_jersey_2.png"), "image/png", pictureService.GetPictureSeName(productChicagoBulls.Name), reference: Domain.Common.Reference.Product, objectId: productChicagoBulls.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productChicagoBulls);--- #endregion-- #region Smartwatches--- var productVivoactive = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Garmin VivoActive",- ShortDescription = "The Vívoactive watch offers easy-to-repeat animated cardio, strength, yoga and Pilates exercises that you can view on your watch screen. Choose from preloaded animated workouts or download more from the Garmin Connect ™ community site.",- FullDescription = "<p>You no longer need to search for videos and advice on the web to know what to do while training. The Vívoactive watch offers easy-to-repeat animated cardio, strength, yoga and Pilates exercises that you can view on your watch screen. Choose from preloaded animated workouts or download more from the Garmin Connect ™ community site.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 30,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductAttributeMappings =- {- new ProductAttributeMapping- {- ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,- AttributeControlTypeId = AttributeControlType.DropdownList,- IsRequired = true,- ProductAttributeValues =- {- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Small",- DisplayOrder = 1,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Medium",- DisplayOrder = 2,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "Large",- DisplayOrder = 3,- },- new ProductAttributeValue- {- AttributeValueTypeId = AttributeValueType.Simple,- Name = "X-Large",- DisplayOrder = 4,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productChicagoBulls);++ productChicagoBulls.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_chicago_jersey_1.png"), "image/png",+ pictureService.GetPictureSeName(productChicagoBulls.Name), reference: Reference.Product,+ objectId: productChicagoBulls.Id)).Id,+ DisplayOrder = 1+ });+ productChicagoBulls.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_chicago_jersey_2.png"), "image/png",+ pictureService.GetPictureSeName(productChicagoBulls.Name), reference: Reference.Product,+ objectId: productChicagoBulls.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productChicagoBulls);++ #endregion++ #region Smartwatches++ var productVivoactive = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Garmin VivoActive",+ ShortDescription =+ "The Vívoactive watch offers easy-to-repeat animated cardio, strength, yoga and Pilates exercises that you can view on your watch screen. Choose from preloaded animated workouts or download more from the Garmin Connect ™ community site.",+ FullDescription =+ "<p>You no longer need to search for videos and advice on the web to know what to do while training. The Vívoactive watch offers easy-to-repeat animated cardio, strength, yoga and Pilates exercises that you can view on your watch screen. Choose from preloaded animated workouts or download more from the Garmin Connect ™ community site.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 30,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductAttributeMappings = {+ new ProductAttributeMapping {+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,+ AttributeControlTypeId = AttributeControlType.DropdownList,+ IsRequired = true,+ ProductAttributeValues = {+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Small",+ DisplayOrder = 1+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Medium",+ DisplayOrder = 2+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "Large",+ DisplayOrder = 3+ },+ new ProductAttributeValue {+ AttributeValueTypeId = AttributeValueType.Simple,+ Name = "X-Large",+ DisplayOrder = 4}}- },- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,- DisplayOrder = 1,- }}- };- allProducts.Add(productVivoactive);- productVivoactive.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_vivoactive.png"), "image/png", pictureService.GetPictureSeName(productVivoactive.Name), reference: Domain.Common.Reference.Product, objectId: productVivoactive.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productVivoactive);---- var productGarminFenix = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Garmin Fenix 2",- ShortDescription = "Fēnix 2 combines the best features of our fitness watches with outdoor training watches. It is both a great navigation system and an ideal training partner in many different sports.",- FullDescription = "<p>Fēnix 2 combines the best features of our fitness watches with outdoor training watches. It is both a great navigation system and an ideal training partner in many different sports. Whether you're running, swimming, skiing, cycling or hiking in the mountains, fēnix 2 lets you easily switch between groups of settings optimized for each activity.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 45,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,- DisplayOrder = 1,- }+ },+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,+ DisplayOrder = 1}- };- allProducts.Add(productGarminFenix);- productGarminFenix.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_garmin_fenix_1.png"), "image/png", pictureService.GetPictureSeName(productGarminFenix.Name), reference: Domain.Common.Reference.Product, objectId: productGarminFenix.Id)).Id,- DisplayOrder = 1,- });- productGarminFenix.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_garmin_fenix_2.png"), "image/png", pictureService.GetPictureSeName(productGarminFenix.Name), reference: Domain.Common.Reference.Product, objectId: productGarminFenix.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productGarminFenix);---- var productForerunner = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Garmin Forerunner",- ShortDescription = "This easy-to-use running watch is great for everyday runs, workouts and even pre-race training in a 10k run. Built-in GPS tracks your running route and provides accurate distance, pace and interval statistics.",- FullDescription = "<p>This easy-to-use running watch is great for everyday runs, workouts and even pre-race training in a 10k run. Built-in GPS tracks your running route and provides accurate distance, pace and interval statistics. Its intuitive interface makes it easy to mark laps or pause the timer, even with sweaty hands. Forerunner 45 also monitors heart rate on the wrist during the day and while you sleep.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 25,- IsShipEnabled = true,- Weight = 7,- Length = 7,- Width = 7,- Height = 7,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productVivoactive);+ productVivoactive.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_vivoactive.png"), "image/png",+ pictureService.GetPictureSeName(productVivoactive.Name), reference: Reference.Product,+ objectId: productVivoactive.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productVivoactive);+++ var productGarminFenix = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Garmin Fenix 2",+ ShortDescription =+ "Fēnix 2 combines the best features of our fitness watches with outdoor training watches. It is both a great navigation system and an ideal training partner in many different sports.",+ FullDescription =+ "<p>Fēnix 2 combines the best features of our fitness watches with outdoor training watches. It is both a great navigation system and an ideal training partner in many different sports. Whether you're running, swimming, skiing, cycling or hiking in the mountains, fēnix 2 lets you easily switch between groups of settings optimized for each activity.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 45,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,+ DisplayOrder = 1}- };- allProducts.Add(productForerunner);- productForerunner.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_forerunner.png"), "image/png", pictureService.GetPictureSeName(productForerunner.Name), reference: Domain.Common.Reference.Product, objectId: productForerunner.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productForerunner);-- #endregion-- #region Digital Downloads--- var downloadCyberpunk1 = new Download- {- DownloadGuid = Guid.NewGuid(),- ContentType = "application/x-zip-co",- DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_cyberpunk_1.zip"),- Extension = ".zip",- Filename = "Cyberpunk",- DownloadType = DownloadType.Product- };- await downloadService.InsertDownload(downloadCyberpunk1);- var downloadCyberpunk2 = new Download- {- DownloadGuid = Guid.NewGuid(),- ContentType = "text/plain",- DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_cyberpunk_2.txt"),- Extension = ".txt",- Filename = "Cyberpunk",- DownloadType = DownloadType.Product- };- await downloadService.InsertDownload(downloadCyberpunk2);- var productCyberpunk = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Cyberpunk 2077",- ShortDescription = "Cyberpunk 2077 is an open-world adventure set in Night City, a megalopolis ruled by an obsessive quest for power, fame and body remake. Your name is V and you must acquire a one-of-a-kind implant - the key to immortality. Create your own playstyle and set out to conquer the mighty city of the future, whose history is shaped by your decisions.",- FullDescription = "<p>Cyberpunk 2077 is an open-world adventure set in Night City, a megalopolis ruled by an obsessive quest for power, fame and body remake. Your name is V and you must acquire a one-of-a-kind implant - the key to immortality. Create your own playstyle and set out to conquer the mighty city of the future, whose history is shaped by your decisions.</p><p>Become a cyberpunk, a freelance armed to the teeth, and become the legend of the most dangerous city of the future. Create your character from scratch. Take on the role of the outlaw Punk, freedom-loving Nomad or ruthless Corp.</p><p>Get the most powerful implant in Night City and take on those who shake the whole city. Follow Rockerboy Johnny Silverhand (played by Keanu Reeves) and change a world ruled by large corporations forever. And all this is accompanied by music from bands and creators such as Run the Jewels, Refused, Grimes, A $ AP Rocky, Gazelle Twin, Ilan Rubin, Richard Devine, Nina Kraviz, Deadly Hunta, Rat Boy and Tina Guo.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 69,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,- ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- IsDownload = true,- DownloadId = downloadCyberpunk1.Id,- DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,- UnlimitedDownloads = true,- HasUserAgreement = false,- HasSampleDownload = true,- SampleDownloadId = downloadCyberpunk2.Id,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productGarminFenix);+ productGarminFenix.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_garmin_fenix_1.png"), "image/png",+ pictureService.GetPictureSeName(productGarminFenix.Name), reference: Reference.Product,+ objectId: productGarminFenix.Id)).Id,+ DisplayOrder = 1+ });+ productGarminFenix.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_garmin_fenix_2.png"), "image/png",+ pictureService.GetPictureSeName(productGarminFenix.Name), reference: Reference.Product,+ objectId: productGarminFenix.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productGarminFenix);+++ var productForerunner = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Garmin Forerunner",+ ShortDescription =+ "This easy-to-use running watch is great for everyday runs, workouts and even pre-race training in a 10k run. Built-in GPS tracks your running route and provides accurate distance, pace and interval statistics.",+ FullDescription =+ "<p>This easy-to-use running watch is great for everyday runs, workouts and even pre-race training in a 10k run. Built-in GPS tracks your running route and provides accurate distance, pace and interval statistics. Its intuitive interface makes it easy to mark laps or pause the timer, even with sweaty hands. Forerunner 45 also monitors heart rate on the wrist during the day and while you sleep.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 25,+ IsShipEnabled = true,+ Weight = 7,+ Length = 7,+ Width = 7,+ Height = 7,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,+ DisplayOrder = 1}- };- allProducts.Add(productCyberpunk);- productCyberpunk.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_cyberpunk_1.png"), "image/png", pictureService.GetPictureSeName(productCyberpunk.Name), reference: Domain.Common.Reference.Product, objectId: productCyberpunk.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productCyberpunk);-- var downloadGTA1 = new Download- {- DownloadGuid = Guid.NewGuid(),- ContentType = "application/x-zip-co",- DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_GTA_1.zip"),- Extension = ".zip",- Filename = "GTA",- DownloadType = DownloadType.Product- };- await downloadService.InsertDownload(downloadGTA1);- var downloadGTA2 = new Download- {- DownloadGuid = Guid.NewGuid(),- ContentType = "text/plain",- DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_GTA_2.txt"),- Extension = ".txt",- Filename = "GTA",- DownloadType = DownloadType.Product- };- await downloadService.InsertDownload(downloadGTA2);- var productGTA = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Grand Theft Auto 5",- ShortDescription = "When a young street hustler, a retired bank robber and a terrifying psychopath land themselves in trouble, they must pull off a series of dangerous heists to survive in a city in which they can trust nobody, least of all each other.",- FullDescription = "<p>When a young street hustler, a retired bank robber and a terrifying psychopath land themselves in trouble, they must pull off a series of dangerous heists to survive in a city in which they can trust nobody, least of all each other.</p><p>Launch business ventures from your Maze Bank West Executive Office, research powerful weapons technology from your underground Gunrunning Bunker and use your Counterfeit Cash Factory to start a lucrative counterfeiting operation.</p><p>Tear through the streets with a range of 10 high performance vehicles including a Supercar, Motorcycles, the weaponized Dune FAV, a Helicopter, a Rally Car and more. You’ll also get properties including a 10 car garage to store your growing fleet.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 49,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,- ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- IsDownload = true,- DownloadId = downloadGTA1.Id,- DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,- UnlimitedDownloads = true,- HasUserAgreement = false,- HasSampleDownload = true,- SampleDownloadId = downloadGTA2.Id,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productForerunner);+ productForerunner.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_forerunner.png"), "image/png",+ pictureService.GetPictureSeName(productForerunner.Name), reference: Reference.Product,+ objectId: productForerunner.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productForerunner);++ #endregion++ #region Digital Downloads++ var downloadCyberpunk1 = new Download {+ DownloadGuid = Guid.NewGuid(),+ ContentType = "application/x-zip-co",+ DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_cyberpunk_1.zip"),+ Extension = ".zip",+ Filename = "Cyberpunk",+ DownloadType = DownloadType.Product+ };+ await downloadService.InsertDownload(downloadCyberpunk1);+ var downloadCyberpunk2 = new Download {+ DownloadGuid = Guid.NewGuid(),+ ContentType = "text/plain",+ DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_cyberpunk_2.txt"),+ Extension = ".txt",+ Filename = "Cyberpunk",+ DownloadType = DownloadType.Product+ };+ await downloadService.InsertDownload(downloadCyberpunk2);+ var productCyberpunk = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Cyberpunk 2077",+ ShortDescription =+ "Cyberpunk 2077 is an open-world adventure set in Night City, a megalopolis ruled by an obsessive quest for power, fame and body remake. Your name is V and you must acquire a one-of-a-kind implant - the key to immortality. Create your own playstyle and set out to conquer the mighty city of the future, whose history is shaped by your decisions.",+ FullDescription =+ "<p>Cyberpunk 2077 is an open-world adventure set in Night City, a megalopolis ruled by an obsessive quest for power, fame and body remake. Your name is V and you must acquire a one-of-a-kind implant - the key to immortality. Create your own playstyle and set out to conquer the mighty city of the future, whose history is shaped by your decisions.</p><p>Become a cyberpunk, a freelance armed to the teeth, and become the legend of the most dangerous city of the future. Create your character from scratch. Take on the role of the outlaw Punk, freedom-loving Nomad or ruthless Corp.</p><p>Get the most powerful implant in Night City and take on those who shake the whole city. Follow Rockerboy Johnny Silverhand (played by Keanu Reeves) and change a world ruled by large corporations forever. And all this is accompanied by music from bands and creators such as Run the Jewels, Refused, Grimes, A $ AP Rocky, Gazelle Twin, Ilan Rubin, Richard Devine, Nina Kraviz, Deadly Hunta, Rat Boy and Tina Guo.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 69,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ IsDownload = true,+ DownloadId = downloadCyberpunk1.Id,+ DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,+ UnlimitedDownloads = true,+ HasUserAgreement = false,+ HasSampleDownload = true,+ SampleDownloadId = downloadCyberpunk2.Id,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,+ DisplayOrder = 1}- };- allProducts.Add(productGTA);-- productGTA.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_gta_1.png"), "image/png", pictureService.GetPictureSeName(productGTA.Name), reference: Domain.Common.Reference.Product, objectId: productGTA.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productGTA);--- var downloadCod = new Download- {- DownloadGuid = Guid.NewGuid(),- ContentType = "application/x-zip-co",- DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_cod_1.zip"),- Extension = ".zip",- Filename = "Call of Duty",- DownloadType = DownloadType.Product- };- await downloadService.InsertDownload(downloadCod);- var productCod = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Call of Duty: ColdWar",- ShortDescription = "The iconic Black Ops series is back with Call of Duty®: Black Ops Cold War - the direct sequel to the original and fan-favorite Call of Duty®: Black Ops. Black Ops Cold War will drop fans into the depths of the Cold War’s volatile geopolitical battle of the early 1980s.",- FullDescription = "<p>The iconic Black Ops series is back with Call of Duty®: Black Ops Cold War - the direct sequel to the original and fan-favorite Call of Duty®: Black Ops. Black Ops Cold War will drop fans into the depths of the Cold War’s volatile geopolitical battle of the early 1980s. Nothing is ever as it seems in a gripping single-player Campaign, where players will come face-to-face with historical figures and hard truths, as they battle around the globe through iconic locales like East Berlin, Vietnam, Turkey, Soviet KGB headquarters and more. As elite operatives, you will follow the trail of a shadowy figure named Perseus who is on a mission to destabilize the global balance of power and change the course of history. Descend into the dark center of this global conspiracy alongside iconic characters Woods, Mason and Hudson and a new cast of operatives attempting to stop a plot decades in the making. Beyond the Campaign, players will bring a Cold War arsenal of weapons and equipment into the next generation of Multiplayer and Zombies experiences.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 69,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,- ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- IsDownload = true,- DownloadId = downloadCod.Id,- DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,- UnlimitedDownloads = true,- HasUserAgreement = false,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productCyberpunk);+ productCyberpunk.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_cyberpunk_1.png"), "image/png",+ pictureService.GetPictureSeName(productCyberpunk.Name), reference: Reference.Product,+ objectId: productCyberpunk.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productCyberpunk);++ var downloadGTA1 = new Download {+ DownloadGuid = Guid.NewGuid(),+ ContentType = "application/x-zip-co",+ DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_GTA_1.zip"),+ Extension = ".zip",+ Filename = "GTA",+ DownloadType = DownloadType.Product+ };+ await downloadService.InsertDownload(downloadGTA1);+ var downloadGTA2 = new Download {+ DownloadGuid = Guid.NewGuid(),+ ContentType = "text/plain",+ DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_GTA_2.txt"),+ Extension = ".txt",+ Filename = "GTA",+ DownloadType = DownloadType.Product+ };+ await downloadService.InsertDownload(downloadGTA2);+ var productGTA = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Grand Theft Auto 5",+ ShortDescription =+ "When a young street hustler, a retired bank robber and a terrifying psychopath land themselves in trouble, they must pull off a series of dangerous heists to survive in a city in which they can trust nobody, least of all each other.",+ FullDescription =+ "<p>When a young street hustler, a retired bank robber and a terrifying psychopath land themselves in trouble, they must pull off a series of dangerous heists to survive in a city in which they can trust nobody, least of all each other.</p><p>Launch business ventures from your Maze Bank West Executive Office, research powerful weapons technology from your underground Gunrunning Bunker and use your Counterfeit Cash Factory to start a lucrative counterfeiting operation.</p><p>Tear through the streets with a range of 10 high performance vehicles including a Supercar, Motorcycles, the weaponized Dune FAV, a Helicopter, a Rally Car and more. You’ll also get properties including a 10 car garage to store your growing fleet.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 49,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ IsDownload = true,+ DownloadId = downloadGTA1.Id,+ DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,+ UnlimitedDownloads = true,+ HasUserAgreement = false,+ HasSampleDownload = true,+ SampleDownloadId = downloadGTA2.Id,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,+ DisplayOrder = 1}- };- allProducts.Add(productCod);- productCod.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_cod_1.png"), "image/png", pictureService.GetPictureSeName(productCod.Name), reference: Domain.Common.Reference.Product, objectId: productCod.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productCod);---- #endregion-- #region Lego-- var productLegoFalcon = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "LEGO Millennium Falcon",- ShortDescription = "Inspire kids and adults with the LEGO® Star Wars ™ 75257 Millennium Falcon model. The brick-built version of the iconic Corellian freighter features a variety of details. This iconic set from the LEGO Star Wars series is a great addition to any fan's collection.",- FullDescription = "<p>Inspire kids and adults with the LEGO® Star Wars ™ 75257 Millennium Falcon model. The brick-built version of the iconic Corellian freighter features a variety of details, including a rotating lower and upper gun turret, 2 spring-loaded shooters, a lowering ramp and an opening cockpit with space for 2 minifigures. The top panels fold out to reveal a detailed interior where children will love to reenact scenes from Star Wars: Skywalker. Rebirth ”featuring characters from the“ Star Wars ”universe - Finn, Chewbakka, Lando Calrissian, Boolio, C-3PO, R2-D2 and D-O. This iconic set from the LEGO Star Wars series is a great addition to any fan's collection.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 109,- OldPrice = 199,- IsShipEnabled = true,- IsFreeShipping = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productGTA);++ productGTA.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_gta_1.png"),+ "image/png", pictureService.GetPictureSeName(productGTA.Name), reference: Reference.Product,+ objectId: productGTA.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productGTA);+++ var downloadCod = new Download {+ DownloadGuid = Guid.NewGuid(),+ ContentType = "application/x-zip-co",+ DownloadBinary = File.ReadAllBytes(sampleDownloadsPath + "product_cod_1.zip"),+ Extension = ".zip",+ Filename = "Call of Duty",+ DownloadType = DownloadType.Product+ };+ await downloadService.InsertDownload(downloadCod);+ var productCod = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Call of Duty: ColdWar",+ ShortDescription =+ "The iconic Black Ops series is back with Call of Duty®: Black Ops Cold War - the direct sequel to the original and fan-favorite Call of Duty®: Black Ops. Black Ops Cold War will drop fans into the depths of the Cold War’s volatile geopolitical battle of the early 1980s.",+ FullDescription =+ "<p>The iconic Black Ops series is back with Call of Duty®: Black Ops Cold War - the direct sequel to the original and fan-favorite Call of Duty®: Black Ops. Black Ops Cold War will drop fans into the depths of the Cold War’s volatile geopolitical battle of the early 1980s. Nothing is ever as it seems in a gripping single-player Campaign, where players will come face-to-face with historical figures and hard truths, as they battle around the globe through iconic locales like East Berlin, Vietnam, Turkey, Soviet KGB headquarters and more. As elite operatives, you will follow the trail of a shadowy figure named Perseus who is on a mission to destabilize the global balance of power and change the course of history. Descend into the dark center of this global conspiracy alongside iconic characters Woods, Mason and Hudson and a new cast of operatives attempting to stop a plot decades in the making. Beyond the Campaign, players will bring a Cold War arsenal of weapons and equipment into the next generation of Multiplayer and Zombies experiences.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 69,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ IsDownload = true,+ DownloadId = downloadCod.Id,+ DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,+ UnlimitedDownloads = true,+ HasUserAgreement = false,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,+ DisplayOrder = 1}- };- allProducts.Add(productLegoFalcon);- productLegoFalcon.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lego_falcon_1.png"), "image/png", pictureService.GetPictureSeName(productLegoFalcon.Name), reference: Domain.Common.Reference.Product, objectId: productLegoFalcon.Id)).Id,- DisplayOrder = 1,- });- productLegoFalcon.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lego_falcon_2.png"), "image/png", pictureService.GetPictureSeName(productLegoFalcon.Name), reference: Domain.Common.Reference.Product, objectId: productLegoFalcon.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productLegoFalcon);---- var productLegoHogwarts = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Lego Hogwarts",- ShortDescription = "Taste real magic at the LEGO® Harry Potter™ Hogwarts™ Castle! Unforgettable building satisfaction with this highly detailed LEGO Harry Potter collectible set with over 6,000 pieces.",- FullDescription = "<p>Taste real magic at the LEGO® Harry Potter™ Hogwarts™ Castle! Unforgettable building satisfaction with this highly detailed LEGO Harry Potter collectible set with over 6,000 pieces. It is packed with elements from the Harry Potter series - you will find towers, turrets, chambers, classrooms, creatures, Whomping Willow ™, Hagrid's hut and many other signature details. Plus, with 4 minifigures and 27 microfigures of students, teachers, statues and 5 Dementors, this advanced construction toy set is the perfect gift for any Harry Potter fan.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 99,- OldPrice = 149,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productCod);+ productCod.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_cod_1.png"),+ "image/png", pictureService.GetPictureSeName(productCod.Name), reference: Reference.Product,+ objectId: productCod.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productCod);++ #endregion++ #region Lego++ var productLegoFalcon = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "LEGO Millennium Falcon",+ ShortDescription =+ "Inspire kids and adults with the LEGO® Star Wars ™ 75257 Millennium Falcon model. The brick-built version of the iconic Corellian freighter features a variety of details. This iconic set from the LEGO Star Wars series is a great addition to any fan's collection.",+ FullDescription =+ "<p>Inspire kids and adults with the LEGO® Star Wars ™ 75257 Millennium Falcon model. The brick-built version of the iconic Corellian freighter features a variety of details, including a rotating lower and upper gun turret, 2 spring-loaded shooters, a lowering ramp and an opening cockpit with space for 2 minifigures. The top panels fold out to reveal a detailed interior where children will love to reenact scenes from Star Wars: Skywalker. Rebirth ”featuring characters from the“ Star Wars ”universe - Finn, Chewbakka, Lando Calrissian, Boolio, C-3PO, R2-D2 and D-O. This iconic set from the LEGO Star Wars series is a great addition to any fan's collection.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 109,+ OldPrice = 199,+ IsShipEnabled = true,+ IsFreeShipping = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,+ DisplayOrder = 1}- };- allProducts.Add(productLegoHogwarts);- productLegoHogwarts.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lego_hogwarts_1.png"), "image/png", pictureService.GetPictureSeName(productLegoHogwarts.Name), reference: Domain.Common.Reference.Product, objectId: productLegoHogwarts.Id)).Id,- DisplayOrder = 1,- });- productLegoHogwarts.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_lego_hogwarts_2.png"), "image/png", pictureService.GetPictureSeName(productLegoHogwarts.Name), reference: Domain.Common.Reference.Product, objectId: productLegoHogwarts.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productLegoHogwarts);-- var productLegoCity = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Lego City Police Base",- ShortDescription = "Everything is awesome about the LEGO® City Police Station (60246) playset. Little law enforcers and fans of the LEGO City TV series will love creating stories with a host of fun characters, including Duke DeTain, Chief Wheeler and Daisy Kaboom. ",- FullDescription = "<p>Everything is awesome about the LEGO® City Police Station (60246) playset. Little law enforcers and fans of the LEGO City TV series will love creating stories with a host of fun characters, including Duke DeTain, Chief Wheeler and Daisy Kaboom. </p><p>This fantastic set includes a police station with a light-brick searchlight and a police car with sound-brick siren, plus a cool truck, motorcycle and surveillance drone. A building toy with a little extra With this toy playset you get a simple building guide and Instructions.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 59,- OldPrice = 99,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productLegoFalcon);+ productLegoFalcon.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lego_falcon_1.png"), "image/png",+ pictureService.GetPictureSeName(productLegoFalcon.Name), reference: Reference.Product,+ objectId: productLegoFalcon.Id)).Id,+ DisplayOrder = 1+ });+ productLegoFalcon.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lego_falcon_2.png"), "image/png",+ pictureService.GetPictureSeName(productLegoFalcon.Name), reference: Reference.Product,+ objectId: productLegoFalcon.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productLegoFalcon);+++ var productLegoHogwarts = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Lego Hogwarts",+ ShortDescription =+ "Taste real magic at the LEGO® Harry Potter™ Hogwarts™ Castle! Unforgettable building satisfaction with this highly detailed LEGO Harry Potter collectible set with over 6,000 pieces.",+ FullDescription =+ "<p>Taste real magic at the LEGO® Harry Potter™ Hogwarts™ Castle! Unforgettable building satisfaction with this highly detailed LEGO Harry Potter collectible set with over 6,000 pieces. It is packed with elements from the Harry Potter series - you will find towers, turrets, chambers, classrooms, creatures, Whomping Willow ™, Hagrid's hut and many other signature details. Plus, with 4 minifigures and 27 microfigures of students, teachers, statues and 5 Dementors, this advanced construction toy set is the perfect gift for any Harry Potter fan.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 99,+ OldPrice = 149,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,+ DisplayOrder = 1}- };- allProducts.Add(productLegoCity);- productLegoCity.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LegoCity_1.png"), "image/png", pictureService.GetPictureSeName(productLegoCity.Name), reference: Domain.Common.Reference.Product, objectId: productLegoCity.Id)).Id,- DisplayOrder = 1,- });- productLegoCity.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_LegoCity_2.png"), "image/png", pictureService.GetPictureSeName(productLegoCity.Name), reference: Domain.Common.Reference.Product, objectId: productLegoCity.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productLegoCity);-- #endregion-- #region Balls-- var productAdidasBall = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Adidas Ball",- ShortDescription = "The Adidas Finale Top Capitano is a durable training ball with strong references to the UEFA Champions League. The ball is a replica of the model used in this year's Champions League group stage and is perfect for training and spontaneous games.",- FullDescription = "<p>The Adidas Finale Top Capitano is a durable training ball with strong references to the UEFA Champions League. The ball is a replica of the model used in this year's Champions League group stage and is perfect for training and spontaneous games. The strong TPU coating has been machine-stitched to increase the durability of the ball. The ball's electrifying multicolored design shows the emotions of fans around the world as Europe's top teams compete for the highest honor.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 69,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- MarkAsNew = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productLegoHogwarts);+ productLegoHogwarts.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lego_hogwarts_1.png"), "image/png",+ pictureService.GetPictureSeName(productLegoHogwarts.Name), reference: Reference.Product,+ objectId: productLegoHogwarts.Id)).Id,+ DisplayOrder = 1+ });+ productLegoHogwarts.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_lego_hogwarts_2.png"), "image/png",+ pictureService.GetPictureSeName(productLegoHogwarts.Name), reference: Reference.Product,+ objectId: productLegoHogwarts.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productLegoHogwarts);++ var productLegoCity = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Lego City Police Base",+ ShortDescription =+ "Everything is awesome about the LEGO® City Police Station (60246) playset. Little law enforcers and fans of the LEGO City TV series will love creating stories with a host of fun characters, including Duke DeTain, Chief Wheeler and Daisy Kaboom. ",+ FullDescription =+ "<p>Everything is awesome about the LEGO® City Police Station (60246) playset. Little law enforcers and fans of the LEGO City TV series will love creating stories with a host of fun characters, including Duke DeTain, Chief Wheeler and Daisy Kaboom. </p><p>This fantastic set includes a police station with a light-brick searchlight and a police car with sound-brick siren, plus a cool truck, motorcycle and surveillance drone. A building toy with a little extra With this toy playset you get a simple building guide and Instructions.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 59,+ OldPrice = 99,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,+ DisplayOrder = 1}- };- allProducts.Add(productAdidasBall);- productAdidasBall.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidasball.png"), "image/png", pictureService.GetPictureSeName(productAdidasBall.Name), reference: Domain.Common.Reference.Product, objectId: productAdidasBall.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productAdidasBall);--- var productMikasa = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Volleyball Ball",- ShortDescription = "Made of high-quality synthetic leather (PU) A high-class ball based on the V200W match model. Solid and strong machine sewing.The 18 - panel, colorful design increases the visibility of the ball during the game.",- FullDescription = "<p>Made of high-quality synthetic leather (PU) A high-class ball based on the V200W match model. Solid and strong machine sewing.The 18 - panel, colorful design increases the visibility of the ball during the game.</p><p> Weight: 260 - 280g </p><p> Circumference: 65 - 67cm </p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 29.99,- IsShipEnabled = true,- IsFreeShipping = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productLegoCity);+ productLegoCity.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_LegoCity_1.png"), "image/png",+ pictureService.GetPictureSeName(productLegoCity.Name), reference: Reference.Product,+ objectId: productLegoCity.Id)).Id,+ DisplayOrder = 1+ });+ productLegoCity.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_LegoCity_2.png"), "image/png",+ pictureService.GetPictureSeName(productLegoCity.Name), reference: Reference.Product,+ objectId: productLegoCity.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productLegoCity);++ #endregion++ #region Balls++ var productAdidasBall = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Adidas Ball",+ ShortDescription =+ "The Adidas Finale Top Capitano is a durable training ball with strong references to the UEFA Champions League. The ball is a replica of the model used in this year's Champions League group stage and is perfect for training and spontaneous games.",+ FullDescription =+ "<p>The Adidas Finale Top Capitano is a durable training ball with strong references to the UEFA Champions League. The ball is a replica of the model used in this year's Champions League group stage and is perfect for training and spontaneous games. The strong TPU coating has been machine-stitched to increase the durability of the ball. The ball's electrifying multicolored design shows the emotions of fans around the world as Europe's top teams compete for the highest honor.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 69,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ MarkAsNew = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,+ DisplayOrder = 1}- };- allProducts.Add(productMikasa);- productMikasa.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_mikasa.png"), "image/png", pictureService.GetPictureSeName(productMikasa.Name), reference: Domain.Common.Reference.Product, objectId: productMikasa.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productMikasa);--- var productSpalding = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "Spalding Basketball Ball",- ShortDescription = "The panels of leather, composite leather are attached to the rubber body by hand. This technique is used for indoor and indoor / outdoor balls. Balloon - the highest quality inner tube that maintains the pressure of the ball.",- FullDescription = "<p>The panels of leather, composite leather are attached to the rubber body by hand. This technique is used for indoor and indoor / outdoor balls. Balloon - the highest quality inner tube that maintains the pressure of the ball. A specialized nylon braid - nylon lines give the ball integrity and durability. Smooth body and channels for a softer feel and strength - optimized deep channel design for better grip and control. Composite leather cover - provides a good grip, feel and aesthetic appearance of the ball, as well as the necessary strength and resistance to abrasion. Composite leather has an advanced moisture management system to improve dry and wet grip.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 49,- IsShipEnabled = true,- Weight = 2,- Length = 2,- Width = 2,- Height = 2,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(productAdidasBall);+ productAdidasBall.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_adidasball.png"), "image/png",+ pictureService.GetPictureSeName(productAdidasBall.Name), reference: Reference.Product,+ objectId: productAdidasBall.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productAdidasBall);+++ var productMikasa = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Volleyball Ball",+ ShortDescription =+ "Made of high-quality synthetic leather (PU) A high-class ball based on the V200W match model. Solid and strong machine sewing.The 18 - panel, colorful design increases the visibility of the ball during the game.",+ FullDescription =+ "<p>Made of high-quality synthetic leather (PU) A high-class ball based on the V200W match model. Solid and strong machine sewing.The 18 - panel, colorful design increases the visibility of the ball during the game.</p><p> Weight: 260 - 280g </p><p> Circumference: 65 - 67cm </p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 29.99,+ IsShipEnabled = true,+ IsFreeShipping = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,+ DisplayOrder = 1}- };- allProducts.Add(productSpalding);- productSpalding.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_spalding.png"), "image/png", pictureService.GetPictureSeName(productSpalding.Name), reference: Domain.Common.Reference.Product, objectId: productSpalding.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(productSpalding);---- #endregion-- #region Gift vouchers--- var product25GiftVoucher = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "$25 Virtual Gift voucher",- ShortDescription = "$25 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",- FullDescription = "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 25,- IsGiftVoucher = true,- GiftVoucherTypeId = GiftVoucherType.Virtual,- ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- Published = true,- ShowOnHomePage = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,- DisplayOrder = 2,- }+ }+ };+ allProducts.Add(productMikasa);+ productMikasa.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_mikasa.png"),+ "image/png", pictureService.GetPictureSeName(productMikasa.Name), reference: Reference.Product,+ objectId: productMikasa.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productMikasa);+++ var productSpalding = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "Spalding Basketball Ball",+ ShortDescription =+ "The panels of leather, composite leather are attached to the rubber body by hand. This technique is used for indoor and indoor / outdoor balls. Balloon - the highest quality inner tube that maintains the pressure of the ball.",+ FullDescription =+ "<p>The panels of leather, composite leather are attached to the rubber body by hand. This technique is used for indoor and indoor / outdoor balls. Balloon - the highest quality inner tube that maintains the pressure of the ball. A specialized nylon braid - nylon lines give the ball integrity and durability. Smooth body and channels for a softer feel and strength - optimized deep channel design for better grip and control. Composite leather cover - provides a good grip, feel and aesthetic appearance of the ball, as well as the necessary strength and resistance to abrasion. Composite leather has an advanced moisture management system to improve dry and wet grip.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 49,+ IsShipEnabled = true,+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 2,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,+ DisplayOrder = 1}- };- allProducts.Add(product25GiftVoucher);- product25GiftVoucher.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_25giftcart.png"), "image/png", pictureService.GetPictureSeName(product25GiftVoucher.Name), reference: Domain.Common.Reference.Product, objectId: product25GiftVoucher.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(product25GiftVoucher);--- var product50GiftVoucher = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "$50 Physical Gift voucher",- ShortDescription = "$50 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",- FullDescription = "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 50,- IsGiftVoucher = true,- GiftVoucherTypeId = GiftVoucherType.Physical,- IsShipEnabled = true,- IsFreeShipping = true,- DeliveryDateId = deliveryDate.Id,- Weight = 1,- Length = 1,- Width = 1,- Height = 1,- ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- Published = true,- MarkAsNew = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,- DisplayOrder = 3,- }+ }+ };+ allProducts.Add(productSpalding);+ productSpalding.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_spalding.png"), "image/png",+ pictureService.GetPictureSeName(productSpalding.Name), reference: Reference.Product,+ objectId: productSpalding.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(productSpalding);++ #endregion++ #region Gift vouchers++ var product25GiftVoucher = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "$25 Virtual Gift voucher",+ ShortDescription =+ "$25 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",+ FullDescription =+ "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 25,+ IsGiftVoucher = true,+ GiftVoucherTypeId = GiftVoucherType.Virtual,+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ Published = true,+ ShowOnHomePage = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,+ DisplayOrder = 2}- };- allProducts.Add(product50GiftVoucher);- product50GiftVoucher.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_50giftcart.png"), "image/png", pictureService.GetPictureSeName(product50GiftVoucher.Name), reference: Domain.Common.Reference.Product, objectId: product50GiftVoucher.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(product50GiftVoucher);--- var product100GiftVoucher = new Product- {- ProductTypeId = ProductType.SimpleProduct,- VisibleIndividually = true,- Name = "$100 Physical Gift voucher",- ShortDescription = "$100 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",- FullDescription = "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 100,- IsGiftVoucher = true,- GiftVoucherTypeId = GiftVoucherType.Physical,- IsShipEnabled = true,- DeliveryDateId = deliveryDate.Id,- Weight = 1,- Length = 1,- Width = 1,- Height = 1,- ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,- DisplayOrder = 4,- }+ }+ };+ allProducts.Add(product25GiftVoucher);+ product25GiftVoucher.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_25giftcart.png"), "image/png",+ pictureService.GetPictureSeName(product25GiftVoucher.Name), reference: Reference.Product,+ objectId: product25GiftVoucher.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(product25GiftVoucher);+++ var product50GiftVoucher = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "$50 Physical Gift voucher",+ ShortDescription =+ "$50 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",+ FullDescription =+ "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 50,+ IsGiftVoucher = true,+ GiftVoucherTypeId = GiftVoucherType.Physical,+ IsShipEnabled = true,+ IsFreeShipping = true,+ DeliveryDateId = deliveryDate.Id,+ Weight = 1,+ Length = 1,+ Width = 1,+ Height = 1,+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ Published = true,+ MarkAsNew = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,+ DisplayOrder = 3}- };- allProducts.Add(product100GiftVoucher);- product100GiftVoucher.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_100giftcart.png"), "image/png", pictureService.GetPictureSeName(product100GiftVoucher.Name), reference: Domain.Common.Reference.Product, objectId: product100GiftVoucher.Id)).Id,- DisplayOrder = 1,- });- await _productRepository.InsertAsync(product100GiftVoucher);-- var productPlaystationBundlePack = new Product- {- ProductTypeId = ProductType.BundledProduct,- VisibleIndividually = true,- Name = "Playstation 5 Kit",- ShortDescription = "Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4™.",- FullDescription = "<p>Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4 ™.</p>",- ProductLayoutId = productLayoutSimple.Id,- AllowCustomerReviews = true,- Price = 259,- IsShipEnabled = true,- Flag = "Bundle Product",- Weight = 2,- Length = 2,- Width = 2,- Height = 3,- TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,- ManageInventoryMethodId = ManageInventoryMethod.ManageStock,- StockQuantity = 10000,- NotifyAdminForQuantityBelow = 1,- AllowOutOfStockSubscriptions = false,- StockAvailability = true,- LowStockActivityId = LowStockActivity.DisableBuyButton,- BackorderModeId = BackorderMode.NoBackorders,- OrderMinimumQuantity = 1,- OrderMaximumQuantity = 10000,- Published = true,- ProductCategories =- {- new ProductCategory- {- CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,- DisplayOrder = 1,- }+ }+ };+ allProducts.Add(product50GiftVoucher);+ product50GiftVoucher.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_50giftcart.png"), "image/png",+ pictureService.GetPictureSeName(product50GiftVoucher.Name), reference: Reference.Product,+ objectId: product50GiftVoucher.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(product50GiftVoucher);+++ var product100GiftVoucher = new Product {+ ProductTypeId = ProductType.SimpleProduct,+ VisibleIndividually = true,+ Name = "$100 Physical Gift voucher",+ ShortDescription =+ "$100 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",+ FullDescription =+ "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 100,+ IsGiftVoucher = true,+ GiftVoucherTypeId = GiftVoucherType.Physical,+ IsShipEnabled = true,+ DeliveryDateId = deliveryDate.Id,+ Weight = 1,+ Length = 1,+ Width = 1,+ Height = 1,+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,+ DisplayOrder = 4}- };- allProducts.Add(productPlaystationBundlePack);- productPlaystationBundlePack.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_console_1.png"), "image/png", pictureService.GetPictureSeName(productPlaystationBundlePack.Name), reference: Domain.Common.Reference.Product, objectId: productPlaystationBundlePack.Id)).Id,- DisplayOrder = 1,- });- productPlaystationBundlePack.ProductPictures.Add(new ProductPicture- {- PictureId = (await pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_console_2.png"), "image/png", pictureService.GetPictureSeName(productPlaystationBundlePack.Name), reference: Domain.Common.Reference.Product, objectId: productPlaystationBundlePack.Id)).Id,- DisplayOrder = 2,- });- await _productRepository.InsertAsync(productPlaystationBundlePack);-- var productbundle1 = new BundleProduct- {- ProductId = productPs4.Id,- DisplayOrder = 1,- Quantity = 1- };- var productbundle2 = new BundleProduct- {- ProductId = productSonyPS5Pad.Id,- DisplayOrder = 2,- Quantity = 2- };- var productbundle3 = new BundleProduct- {- ProductId = productPs5Camera.Id,- DisplayOrder = 3,- Quantity = 1- };- var productbundle4 = new BundleProduct- {- ProductId = productCod.Id,- DisplayOrder = 4,- Quantity = 1- };- productPlaystationBundlePack.BundleProducts.Add(productbundle1);- productPlaystationBundlePack.BundleProducts.Add(productbundle2);- productPlaystationBundlePack.BundleProducts.Add(productbundle3);- productPlaystationBundlePack.BundleProducts.Add(productbundle4);- await _productRepository.UpdateAsync(productPlaystationBundlePack);-- #endregion-- //search engine names- foreach (var product in allProducts)- {- product.SeName = SeoExtensions.GenerateSlug(product.Name, false, false, false);- await _entityUrlRepository.InsertAsync(new EntityUrl- {- EntityId = product.Id,- EntityName = "Product",- LanguageId = "",- IsActive = true,- Slug = product.SeName,- });-- await _productRepository.UpdateAsync(product);}+ };+ allProducts.Add(product100GiftVoucher);+ product100GiftVoucher.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_100giftcart.png"), "image/png",+ pictureService.GetPictureSeName(product100GiftVoucher.Name), reference: Reference.Product,+ objectId: product100GiftVoucher.Id)).Id,+ DisplayOrder = 1+ });+ await _productRepository.InsertAsync(product100GiftVoucher);++ var productPlaystationBundlePack = new Product {+ ProductTypeId = ProductType.BundledProduct,+ VisibleIndividually = true,+ Name = "Playstation 5 Kit",+ ShortDescription =+ "Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4™.",+ FullDescription =+ "<p>Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4 ™.</p>",+ ProductLayoutId = productLayoutSimple.Id,+ AllowCustomerReviews = true,+ Price = 259,+ IsShipEnabled = true,+ Flag = "Bundle Product",+ Weight = 2,+ Length = 2,+ Width = 2,+ Height = 3,+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,+ StockQuantity = 10000,+ NotifyAdminForQuantityBelow = 1,+ AllowOutOfStockSubscriptions = false,+ StockAvailability = true,+ LowStockActivityId = LowStockActivity.DisableBuyButton,+ BackorderModeId = BackorderMode.NoBackorders,+ OrderMinimumQuantity = 1,+ OrderMaximumQuantity = 10000,+ Published = true,+ ProductCategories = {+ new ProductCategory {+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,+ DisplayOrder = 1+ }+ }+ };+ allProducts.Add(productPlaystationBundlePack);+ productPlaystationBundlePack.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_console_1.png"), "image/png",+ pictureService.GetPictureSeName(productPlaystationBundlePack.Name), reference: Reference.Product,+ objectId: productPlaystationBundlePack.Id)).Id,+ DisplayOrder = 1+ });+ productPlaystationBundlePack.ProductPictures.Add(new ProductPicture {+ PictureId = (await pictureService.InsertPicture(+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_console_2.png"), "image/png",+ pictureService.GetPictureSeName(productPlaystationBundlePack.Name), reference: Reference.Product,+ objectId: productPlaystationBundlePack.Id)).Id,+ DisplayOrder = 2+ });+ await _productRepository.InsertAsync(productPlaystationBundlePack);++ var productbundle1 = new BundleProduct {+ ProductId = productPs4.Id,+ DisplayOrder = 1,+ Quantity = 1+ };+ var productbundle2 = new BundleProduct {+ ProductId = productSonyPS5Pad.Id,+ DisplayOrder = 2,+ Quantity = 2+ };+ var productbundle3 = new BundleProduct {+ ProductId = productPs5Camera.Id,+ DisplayOrder = 3,+ Quantity = 1+ };+ var productbundle4 = new BundleProduct {+ ProductId = productCod.Id,+ DisplayOrder = 4,+ Quantity = 1+ };+ productPlaystationBundlePack.BundleProducts.Add(productbundle1);+ productPlaystationBundlePack.BundleProducts.Add(productbundle2);+ productPlaystationBundlePack.BundleProducts.Add(productbundle3);+ productPlaystationBundlePack.BundleProducts.Add(productbundle4);+ await _productRepository.UpdateAsync(productPlaystationBundlePack);++ #endregion++ //search engine names+ foreach (var product in allProducts)+ {+ product.SeName = SeoExtensions.GenerateSlug(product.Name, false, false, false);+ await _entityUrlRepository.InsertAsync(new EntityUrl {+ EntityId = product.Id,+ EntityName = "Product",+ LanguageId = "",+ IsActive = true,+ Slug = product.SeName+ });++ await _productRepository.UpdateAsync(product);+ }- #region Related Products-- //related products-- productMikasa.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productSpalding.Id,- });-- productMikasa.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAdidasBall.Id,- });-- productSpalding.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMikasa.Id,- });-- productSpalding.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAdidasBall.Id,- });-- productAdidasBall.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMikasa.Id,- });-- productAdidasBall.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productSpalding.Id,- });-- productGTA.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productCyberpunk.Id,- });-- productGTA.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productCod.Id,- });-- productCyberpunk.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productGTA.Id,- });-- productCyberpunk.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productCod.Id,- });-- productLegoCity.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLegoHogwarts.Id,- });-- productLegoCity.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLegoFalcon.Id,- });-- productLegoHogwarts.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLegoCity.Id,- });-- productLegoHogwarts.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLegoFalcon.Id,- });-- productLegoFalcon.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLegoHogwarts.Id,- });-- productLegoFalcon.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLegoCity.Id,- });-- productLenovoLegionY740.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellXPS.Id,- });-- productLenovoLegionY740.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiNotebook.Id,- });-- productLenovoLegionY740.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAsusMixedReality.Id,- });-- productLenovoLegionY740.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerNitro.Id,- });-- productDellXPS.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLenovoLegionY740.Id,- });-- productDellXPS.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiNotebook.Id,- });-- productDellXPS.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerMonitor.Id,- });-- productDellXPS.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellG5.Id,- });-- productMiNotebook.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellXPS.Id,- });-- productMiNotebook.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerMonitor.Id,- });-- productMiNotebook.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLenovoLegionY740.Id,- });-- productMiNotebook.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerNitro.Id,- });-- productAcerNitro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellXPS.Id,- });-- productAcerNitro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerProjector.Id,- });-- productAcerNitro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLenovoLegionY740.Id,- });-- productAcerNitro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellG5.Id,- });-- productDellG5.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLenovoLegionY740.Id,- });-- productDellG5.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiNotebook.Id,- });-- productDellG5.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerNitro.Id,- });-- productDellG5.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerMonitor.Id,- });- productPs5Camera.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productPlaystationBundlePack.Id,- });- productPs5Camera.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productPs4.Id,- });-- productPs5Camera.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellG5.Id,- });- productPs5Camera.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerNitro.Id,- });- productAcerProjector.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productRedmiNote9.Id,- });-- productAcerProjector.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDerbyKit.Id,- });-- productAcerProjector.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAcerMonitor.Id,- });-- productAcerProjector.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productPocoF2Pro.Id,- });- productRedmiK30.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productRedmiNote9.Id,- });-- productRedmiK30.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productPocoF2Pro.Id,- });- productRedmiK30.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiSmartBand.Id,- });-- productRedmiK30.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiBeard.Id,- });-- productRedmiNote9.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productRedmiK30.Id,- });- productRedmiNote9.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productPocoF2Pro.Id,- });-- productRedmiNote9.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiSmartBand.Id,- });- productRedmiNote9.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiBeard.Id,- });- productPocoF2Pro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productRedmiK30.Id,- });- productPocoF2Pro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productRedmiNote9.Id,- });-- productPocoF2Pro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiSmartBand.Id,- });- productPocoF2Pro.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiBeard.Id,- });-- productAdidasNitrocharge.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productChicagoBulls.Id,- });-- productAdidasNitrocharge.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAdidasPredator.Id,- });-- productAdidasNitrocharge.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAdidasTurfs.Id,- });- productAdidasNitrocharge.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productNikeKids.Id,- });- productChicagoBulls.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAdidasNitrocharge.Id,- });- productChicagoBulls.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAdidasPredator.Id,- });-- productChicagoBulls.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productAdidasTurfs.Id,- });- productChicagoBulls.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productNikeKids.Id,- });-- productDerbyShirt.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productChicagoBulls.Id,- });-- productDerbyShirt.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productNikeKids.Id,- });- productDerbyShirt.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productPsgKit.Id,- });- productDerbyShirt.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productVivoactive.Id,- });- productSonyPS5Pad.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productBuildComputer.Id,- });- productSonyPS5Pad.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productLenovoIdeaPadDual.Id,- });- productSonyPS5Pad.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellXPS.Id,- });- productSonyPS5Pad.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiNotebook.Id,- });-- productLenovoIdeaPadDual.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productBuildComputer.Id,- });-- productLenovoIdeaPadDual.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productSonyPS5Pad.Id,- });-- productLenovoIdeaPadDual.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productDellXPS.Id,- });-- productLenovoIdeaPadDual.RelatedProducts.Add(- new RelatedProduct- {- ProductId2 = productMiNotebook.Id,- });--- #endregion-- #region Product Tags-- //product tags- await AddProductTag(product25GiftVoucher, "nice");- await AddProductTag(product25GiftVoucher, "gift");- await AddProductTag(productNikeKids, "cool");- await AddProductTag(productNikeKids, "apparel");- await AddProductTag(productNikeKids, "shirt");- await AddProductTag(productMiSmartBand, "computer");- await AddProductTag(productMiSmartBand, "cool");- await AddProductTag(productAdidasPredator, "cool");- await AddProductTag(productAdidasPredator, "shoes");- await AddProductTag(productAdidasPredator, "apparel");- await AddProductTag(productLenovoYogaDuet, "tablet");- await AddProductTag(productLenovoYogaDuet, "awesome");- await AddProductTag(productPs4, "computer");- await AddProductTag(productPs4, "cool");- await AddProductTag(productPsgKit, "cool");- await AddProductTag(productPsgKit, "apparel");- await AddProductTag(productPsgKit, "shirt");- await AddProductTag(productMiNotebook, "compact");- await AddProductTag(productMiNotebook, "awesome");- await AddProductTag(productMiNotebook, "computer");- await AddProductTag(productLenovoLegionY740, "compact");- await AddProductTag(productLenovoLegionY740, "awesome");- await AddProductTag(productLenovoLegionY740, "computer");- await AddProductTag(productLegoFalcon, "awesome");- await AddProductTag(productLegoFalcon, "lego");- await AddProductTag(productLegoFalcon, "nice");- await AddProductTag(productRedmiK30, "cell");- await AddProductTag(productRedmiK30, "compact");- await AddProductTag(productRedmiK30, "awesome");- await AddProductTag(productBuildComputer, "awesome");- await AddProductTag(productBuildComputer, "computer");- await AddProductTag(productDerbyKit, "cool");- await AddProductTag(productDerbyKit, "football kit");- await AddProductTag(productAcerProjector, "projector");- await AddProductTag(productAcerProjector, "cool");- await AddProductTag(productSonyPS5Pad, "cool");- await AddProductTag(productSonyPS5Pad, "computer");- await AddProductTag(productLenovoSmartTab, "awesome");- await AddProductTag(productLenovoSmartTab, "tablet");- await AddProductTag(productDerbyShirt, "cool");- await AddProductTag(productDerbyShirt, "shirt");- await AddProductTag(productDerbyShirt, "apparel");- await AddProductTag(productAdidasBall, "Balls");- await AddProductTag(productAdidasBall, "awesome");- await AddProductTag(productMikasa, "awesome");- await AddProductTag(productMikasa, "Balls");- await AddProductTag(productLegoHogwarts, "lego");- await AddProductTag(productAdidasNitrocharge, "cool");- await AddProductTag(productAdidasNitrocharge, "shoes");- await AddProductTag(productAdidasNitrocharge, "apparel");- await AddProductTag(productLenovoIdeaPadDual, "awesome");- await AddProductTag(productLenovoIdeaPadDual, "tablet");- await AddProductTag(productPs5Camera, "nice");- await AddProductTag(productPs5Camera, "computer");- await AddProductTag(productPs5Camera, "compact");- await AddProductTag(productAcerNitro, "nice");- await AddProductTag(productAcerNitro, "computer");- await AddProductTag(productDellG5, "computer");- await AddProductTag(productDellG5, "cool");- await AddProductTag(productDellG5, "compact");- await AddProductTag(productVivoactive, "apparel");- await AddProductTag(productVivoactive, "cool");- await AddProductTag(productChicagoBulls, "cool");- await AddProductTag(productChicagoBulls, "sport");- await AddProductTag(productChicagoBulls, "apparel");- await AddProductTag(productAsusMixedReality, "game");- await AddProductTag(productAsusMixedReality, "computer");- await AddProductTag(productAsusMixedReality, "cool");- await AddProductTag(productCyberpunk, "awesome");- await AddProductTag(productCyberpunk, "digital");- await AddProductTag(productForerunner, "apparel");- await AddProductTag(productForerunner, "cool");- await AddProductTag(productRedmiNote9, "awesome");- await AddProductTag(productRedmiNote9, "compact");- await AddProductTag(productRedmiNote9, "cell");- await AddProductTag(productGTA, "digital");- await AddProductTag(productGTA, "game");- await AddProductTag(productPocoF2Pro, "awesome");- await AddProductTag(productPocoF2Pro, "cool");- await AddProductTag(productPocoF2Pro, "camera");- await AddProductTag(productCod, "digital");- await AddProductTag(productCod, "awesome");- await AddProductTag(productLegoCity, "lego");- await AddProductTag(productDellXPS, "awesome");- await AddProductTag(productDellXPS, "computer");- await AddProductTag(productDellXPS, "compact");- await AddProductTag(productAdidasTurfs, "jeans");- await AddProductTag(productAdidasTurfs, "cool");- await AddProductTag(productAdidasTurfs, "apparel");- await AddProductTag(productSpalding, "Balls");- await AddProductTag(productSpalding, "awesome");--- #endregion-- //reviews- var random = new Random();- foreach (var product in allProducts)- {- if (product.ProductTypeId != ProductType.SimpleProduct)- continue;-- //only 3 of 4 products will have reviews- if (random.Next(4) == 3)- continue;-- //rating from 4 to 5- var rating = random.Next(4, 6);- var productReview = new ProductReview- {- CustomerId = defaultCustomer.Id,- ProductId = product.Id,- IsApproved = true,- StoreId = defaultStore.Id,- Title = "Some sample review",- ReviewText =- $"This sample review is for the {product.Name}. I've been waiting for this product to be available. It is priced just right.",- Rating = rating,- HelpfulYesTotal = 0,- HelpfulNoTotal = 0-- };- await _productReviewRepository.InsertAsync(productReview);-- product.ApprovedRatingSum = rating;- product.ApprovedTotalReviews += 1;- product.AvgRating = rating / product.ApprovedTotalReviews;- }- allProducts.ForEach(x=>_productRepository.Update(x));+ #region Related Products++ //related products++ productMikasa.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productSpalding.Id+ });++ productMikasa.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAdidasBall.Id+ });++ productSpalding.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMikasa.Id+ });++ productSpalding.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAdidasBall.Id+ });++ productAdidasBall.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMikasa.Id+ });++ productAdidasBall.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productSpalding.Id+ });++ productGTA.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productCyberpunk.Id+ });++ productGTA.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productCod.Id+ });++ productCyberpunk.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productGTA.Id+ });++ productCyberpunk.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productCod.Id+ });++ productLegoCity.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLegoHogwarts.Id+ });++ productLegoCity.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLegoFalcon.Id+ });++ productLegoHogwarts.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLegoCity.Id+ });++ productLegoHogwarts.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLegoFalcon.Id+ });++ productLegoFalcon.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLegoHogwarts.Id+ });++ productLegoFalcon.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLegoCity.Id+ });++ productLenovoLegionY740.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellXPS.Id+ });++ productLenovoLegionY740.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiNotebook.Id+ });++ productLenovoLegionY740.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAsusMixedReality.Id+ });++ productLenovoLegionY740.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerNitro.Id+ });++ productDellXPS.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLenovoLegionY740.Id+ });++ productDellXPS.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiNotebook.Id+ });++ productDellXPS.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerMonitor.Id+ });++ productDellXPS.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellG5.Id+ });++ productMiNotebook.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellXPS.Id+ });++ productMiNotebook.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerMonitor.Id+ });++ productMiNotebook.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLenovoLegionY740.Id+ });++ productMiNotebook.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerNitro.Id+ });++ productAcerNitro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellXPS.Id+ });++ productAcerNitro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerProjector.Id+ });++ productAcerNitro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLenovoLegionY740.Id+ });++ productAcerNitro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellG5.Id+ });++ productDellG5.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLenovoLegionY740.Id+ });++ productDellG5.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiNotebook.Id+ });++ productDellG5.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerNitro.Id+ });++ productDellG5.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerMonitor.Id+ });+ productPs5Camera.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productPlaystationBundlePack.Id+ });+ productPs5Camera.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productPs4.Id+ });++ productPs5Camera.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellG5.Id+ });+ productPs5Camera.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerNitro.Id+ });+ productAcerProjector.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productRedmiNote9.Id+ });++ productAcerProjector.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDerbyKit.Id+ });++ productAcerProjector.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAcerMonitor.Id+ });++ productAcerProjector.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productPocoF2Pro.Id+ });+ productRedmiK30.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productRedmiNote9.Id+ });++ productRedmiK30.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productPocoF2Pro.Id+ });+ productRedmiK30.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiSmartBand.Id+ });++ productRedmiK30.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiBeard.Id+ });++ productRedmiNote9.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productRedmiK30.Id+ });+ productRedmiNote9.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productPocoF2Pro.Id+ });++ productRedmiNote9.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiSmartBand.Id+ });+ productRedmiNote9.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiBeard.Id+ });+ productPocoF2Pro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productRedmiK30.Id+ });+ productPocoF2Pro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productRedmiNote9.Id+ });++ productPocoF2Pro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiSmartBand.Id+ });+ productPocoF2Pro.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiBeard.Id+ });++ productAdidasNitrocharge.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productChicagoBulls.Id+ });++ productAdidasNitrocharge.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAdidasPredator.Id+ });++ productAdidasNitrocharge.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAdidasTurfs.Id+ });+ productAdidasNitrocharge.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productNikeKids.Id+ });+ productChicagoBulls.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAdidasNitrocharge.Id+ });+ productChicagoBulls.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAdidasPredator.Id+ });++ productChicagoBulls.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productAdidasTurfs.Id+ });+ productChicagoBulls.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productNikeKids.Id+ });++ productDerbyShirt.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productChicagoBulls.Id+ });++ productDerbyShirt.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productNikeKids.Id+ });+ productDerbyShirt.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productPsgKit.Id+ });+ productDerbyShirt.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productVivoactive.Id+ });+ productSonyPS5Pad.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productBuildComputer.Id+ });+ productSonyPS5Pad.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productLenovoIdeaPadDual.Id+ });+ productSonyPS5Pad.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellXPS.Id+ });+ productSonyPS5Pad.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiNotebook.Id+ });++ productLenovoIdeaPadDual.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productBuildComputer.Id+ });++ productLenovoIdeaPadDual.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productSonyPS5Pad.Id+ });++ productLenovoIdeaPadDual.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productDellXPS.Id+ });++ productLenovoIdeaPadDual.RelatedProducts.Add(+ new RelatedProduct {+ ProductId2 = productMiNotebook.Id+ });++ #endregion++ #region Product Tags++ //product tags+ await AddProductTag(product25GiftVoucher, "nice");+ await AddProductTag(product25GiftVoucher, "gift");+ await AddProductTag(productNikeKids, "cool");+ await AddProductTag(productNikeKids, "apparel");+ await AddProductTag(productNikeKids, "shirt");+ await AddProductTag(productMiSmartBand, "computer");+ await AddProductTag(productMiSmartBand, "cool");+ await AddProductTag(productAdidasPredator, "cool");+ await AddProductTag(productAdidasPredator, "shoes");+ await AddProductTag(productAdidasPredator, "apparel");+ await AddProductTag(productLenovoYogaDuet, "tablet");+ await AddProductTag(productLenovoYogaDuet, "awesome");+ await AddProductTag(productPs4, "computer");+ await AddProductTag(productPs4, "cool");+ await AddProductTag(productPsgKit, "cool");+ await AddProductTag(productPsgKit, "apparel");+ await AddProductTag(productPsgKit, "shirt");+ await AddProductTag(productMiNotebook, "compact");+ await AddProductTag(productMiNotebook, "awesome");+ await AddProductTag(productMiNotebook, "computer");+ await AddProductTag(productLenovoLegionY740, "compact");+ await AddProductTag(productLenovoLegionY740, "awesome");+ await AddProductTag(productLenovoLegionY740, "computer");+ await AddProductTag(productLegoFalcon, "awesome");+ await AddProductTag(productLegoFalcon, "lego");+ await AddProductTag(productLegoFalcon, "nice");+ await AddProductTag(productRedmiK30, "cell");+ await AddProductTag(productRedmiK30, "compact");+ await AddProductTag(productRedmiK30, "awesome");+ await AddProductTag(productBuildComputer, "awesome");+ await AddProductTag(productBuildComputer, "computer");+ await AddProductTag(productDerbyKit, "cool");+ await AddProductTag(productDerbyKit, "football kit");+ await AddProductTag(productAcerProjector, "projector");+ await AddProductTag(productAcerProjector, "cool");+ await AddProductTag(productSonyPS5Pad, "cool");+ await AddProductTag(productSonyPS5Pad, "computer");+ await AddProductTag(productLenovoSmartTab, "awesome");+ await AddProductTag(productLenovoSmartTab, "tablet");+ await AddProductTag(productDerbyShirt, "cool");+ await AddProductTag(productDerbyShirt, "shirt");+ await AddProductTag(productDerbyShirt, "apparel");+ await AddProductTag(productAdidasBall, "Balls");+ await AddProductTag(productAdidasBall, "awesome");+ await AddProductTag(productMikasa, "awesome");+ await AddProductTag(productMikasa, "Balls");+ await AddProductTag(productLegoHogwarts, "lego");+ await AddProductTag(productAdidasNitrocharge, "cool");+ await AddProductTag(productAdidasNitrocharge, "shoes");+ await AddProductTag(productAdidasNitrocharge, "apparel");+ await AddProductTag(productLenovoIdeaPadDual, "awesome");+ await AddProductTag(productLenovoIdeaPadDual, "tablet");+ await AddProductTag(productPs5Camera, "nice");+ await AddProductTag(productPs5Camera, "computer");+ await AddProductTag(productPs5Camera, "compact");+ await AddProductTag(productAcerNitro, "nice");+ await AddProductTag(productAcerNitro, "computer");+ await AddProductTag(productDellG5, "computer");+ await AddProductTag(productDellG5, "cool");+ await AddProductTag(productDellG5, "compact");+ await AddProductTag(productVivoactive, "apparel");+ await AddProductTag(productVivoactive, "cool");+ await AddProductTag(productChicagoBulls, "cool");+ await AddProductTag(productChicagoBulls, "sport");+ await AddProductTag(productChicagoBulls, "apparel");+ await AddProductTag(productAsusMixedReality, "game");+ await AddProductTag(productAsusMixedReality, "computer");+ await AddProductTag(productAsusMixedReality, "cool");+ await AddProductTag(productCyberpunk, "awesome");+ await AddProductTag(productCyberpunk, "digital");+ await AddProductTag(productForerunner, "apparel");+ await AddProductTag(productForerunner, "cool");+ await AddProductTag(productRedmiNote9, "awesome");+ await AddProductTag(productRedmiNote9, "compact");+ await AddProductTag(productRedmiNote9, "cell");+ await AddProductTag(productGTA, "digital");+ await AddProductTag(productGTA, "game");+ await AddProductTag(productPocoF2Pro, "awesome");+ await AddProductTag(productPocoF2Pro, "cool");+ await AddProductTag(productPocoF2Pro, "camera");+ await AddProductTag(productCod, "digital");+ await AddProductTag(productCod, "awesome");+ await AddProductTag(productLegoCity, "lego");+ await AddProductTag(productDellXPS, "awesome");+ await AddProductTag(productDellXPS, "computer");+ await AddProductTag(productDellXPS, "compact");+ await AddProductTag(productAdidasTurfs, "jeans");+ await AddProductTag(productAdidasTurfs, "cool");+ await AddProductTag(productAdidasTurfs, "apparel");+ await AddProductTag(productSpalding, "Balls");+ await AddProductTag(productSpalding, "awesome");++ #endregion++ //reviews+ var random = new Random();+ foreach (var product in allProducts)+ {+ if (product.ProductTypeId != ProductType.SimpleProduct)+ continue;++ //only 3 of 4 products will have reviews+ if (random.Next(4) == 3)+ continue;++ //rating from 4 to 5+ var rating = random.Next(4, 6);+ var productReview = new ProductReview {+ CustomerId = defaultCustomer.Id,+ ProductId = product.Id,+ IsApproved = true,+ StoreId = defaultStore.Id,+ Title = "Some sample review",+ ReviewText =+ $"This sample review is for the {product.Name}. I've been waiting for this product to be available. It is priced just right.",+ Rating = rating,+ HelpfulYesTotal = 0,+ HelpfulNoTotal = 0+ };+ await _productReviewRepository.InsertAsync(productReview);++ product.ApprovedRatingSum = rating;+ product.ApprovedTotalReviews += 1;+ product.AvgRating = rating / product.ApprovedTotalReviews;}- private async Task AddProductTag(Product product, string tag)++ allProducts.ForEach(x => _productRepository.Update(x));+ }++ private async Task AddProductTag(Product product, string tag)+ {+ var productTag = _productTagRepository.Table.FirstOrDefault(pt => pt.Name == tag);+ if (productTag == null){- var productTag = _productTagRepository.Table.FirstOrDefault(pt => pt.Name == tag);- if (productTag == null)- {- productTag = new ProductTag- {- Name = tag,- SeName = SeoExtensions.GenerateSlug(tag, false, false, false),- };-- await _productTagRepository.InsertAsync(productTag);- }- productTag.Count = productTag.Count + 1;- await _productTagRepository.UpdateAsync(productTag);- product.ProductTags.Add(productTag.Name);- await _productRepository.UpdateAsync(product);+ productTag = new ProductTag {+ Name = tag,+ SeName = SeoExtensions.GenerateSlug(tag, false, false, false)+ };++ await _productTagRepository.InsertAsync(productTag);}++ productTag.Count = productTag.Count + 1;+ await _productTagRepository.UpdateAsync(productTag);+ product.ProductTags.Add(productTag.Name);+ await _productRepository.UpdateAsync(product);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataRobotsTxt.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataRobotsTxt.csindex 82232b69b..1a62c5b5e 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataRobotsTxt.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataRobotsTxt.cs@@ -1,19 +1,19 @@using Grand.Domain.Common;using Grand.Domain.Stores;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallDataRobotsTxt(+ Store store){- protected virtual async Task InstallDataRobotsTxt(- Store store)- {- var url = store.SslEnabled ? store.SecureUrl : store.Url;+ var url = store.SslEnabled ? store.SecureUrl : store.Url;- var robotsTxt = new RobotsTxt {- Name = "RobotsTXT",- StoreId = store.Id,- Text = @$"User-agent: *+ var robotsTxt = new RobotsTxt {+ Name = "RobotsTXT",+ StoreId = store.Id,+ Text = @$"User-agent: *Sitemap: {url}sitemap.xmlHost: {url}Disallow: /admin@@ -51,9 +51,8 @@ Disallow: /uploadfileproductattributeDisallow: /uploadfilecheckoutattributeDisallow: /wishlistDisallow: /quickview/*"- };+ };- await _robotsTxtRepository.InsertAsync(robotsTxt);- }+ await _robotsTxtRepository.InsertAsync(robotsTxt);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataScheduleTasks.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataScheduleTasks.csindex 303df101e..4a8c6b7b2 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataScheduleTasks.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataScheduleTasks.cs@@ -1,75 +1,73 @@using Grand.Domain.Tasks;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallScheduleTasks(){- protected virtual Task InstallScheduleTasks()- {- //these tasks are default - they are created in order to insert them into database- //and nothing above it- //there is no need to send arguments into ctor - all are null- var tasks = new List<ScheduleTask>- {- new ScheduleTask- {- ScheduleTaskName = "Send emails",- Type = "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.QueuedMessagesSendScheduleTask, Grand.Business.System",- Enabled = true,- StopOnError = false,- TimeInterval = 1- },- new ScheduleTask- {- ScheduleTaskName = "Delete guests",- Type = "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.DeleteGuestsScheduleTask, Grand.Business.System",- Enabled = true,- StopOnError = false,- TimeInterval = 1440- },- new ScheduleTask- {- ScheduleTaskName = "Clear cache",- Type = "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.ClearCacheScheduleTask, Grand.Business.System",- Enabled = false,- StopOnError = false,- TimeInterval = 120- },- new ScheduleTask- {- ScheduleTaskName = "Update currency exchange rates",- Type = "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.UpdateExchangeRateScheduleTask, Grand.Business.System",- Enabled = true,- StopOnError = false,- TimeInterval = 1440- },- new ScheduleTask- {- ScheduleTaskName = "Generate sitemap XML file",- Type = "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.GenerateSitemapXmlTask, Grand.Business.System",- Enabled = false,- StopOnError = false,- TimeInterval = 10080- },- new ScheduleTask- {- ScheduleTaskName = "End of the auctions",- Type = "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.EndAuctionsTask, Grand.Business.System",- Enabled = false,- StopOnError = false,- TimeInterval = 60- },- new ScheduleTask- {- ScheduleTaskName = "Cancel unpaid and pending orders",- Type = "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.CancelOrderScheduledTask, Grand.Business.System",- Enabled = false,- StopOnError = false,- TimeInterval = 1440- }- };- tasks.ForEach(x=>_scheduleTaskRepository.Insert(x));- return Task.CompletedTask;- }+ //these tasks are default - they are created in order to insert them into database+ //and nothing above it+ //there is no need to send arguments into ctor - all are null+ var tasks = new List<ScheduleTask> {+ new() {+ ScheduleTaskName = "Send emails",+ Type =+ "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.QueuedMessagesSendScheduleTask, Grand.Business.System",+ Enabled = true,+ StopOnError = false,+ TimeInterval = 1+ },+ new() {+ ScheduleTaskName = "Delete guests",+ Type =+ "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.DeleteGuestsScheduleTask, Grand.Business.System",+ Enabled = true,+ StopOnError = false,+ TimeInterval = 1440+ },+ new() {+ ScheduleTaskName = "Clear cache",+ Type =+ "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.ClearCacheScheduleTask, Grand.Business.System",+ Enabled = false,+ StopOnError = false,+ TimeInterval = 120+ },+ new() {+ ScheduleTaskName = "Update currency exchange rates",+ Type =+ "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.UpdateExchangeRateScheduleTask, Grand.Business.System",+ Enabled = true,+ StopOnError = false,+ TimeInterval = 1440+ },+ new() {+ ScheduleTaskName = "Generate sitemap XML file",+ Type =+ "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.GenerateSitemapXmlTask, Grand.Business.System",+ Enabled = false,+ StopOnError = false,+ TimeInterval = 10080+ },+ new() {+ ScheduleTaskName = "End of the auctions",+ Type =+ "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.EndAuctionsTask, Grand.Business.System",+ Enabled = false,+ StopOnError = false,+ TimeInterval = 60+ },+ new() {+ ScheduleTaskName = "Cancel unpaid and pending orders",+ Type =+ "Grand.Business.System.Services.BackgroundServices.ScheduleTasks.CancelOrderScheduledTask, Grand.Business.System",+ Enabled = false,+ StopOnError = false,+ TimeInterval = 1440+ }+ };+ tasks.ForEach(x => _scheduleTaskRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.csindex c822a7267..184c84b06 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs@@ -23,535 +23,535 @@ using Grand.Domain.Tax;using Grand.Domain.Vendors;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallSettings(bool installSampleData){- protected virtual async Task InstallSettings(bool installSampleData)- {- var _settingService = _serviceProvider.GetRequiredService<ISettingService>();- var _pictureService = _serviceProvider.GetRequiredService<IPictureService>();-- var path = Path.Combine(_hostingEnvironment.WebRootPath, "logo.png");-- var storePictureId = (await _pictureService.InsertPicture(File.ReadAllBytes(path), "image/png", "Logo")).Id;-- await _settingService.SaveSetting(new MenuItemSettings {- DisplayHomePageMenu = !installSampleData,- DisplayNewProductsMenu = true,- DisplaySearchMenu = !installSampleData,- DisplayCustomerMenu = !installSampleData,- DisplayBlogMenu = true,- DisplayContactUsMenu = true- });-- await _settingService.SaveSetting(new PdfSettings {- LogoPictureId = "",- InvoiceHeaderText = null,- InvoiceFooterText = null- });-- await _settingService.SaveSetting(new CommonSettings {- StoreInDatabaseContactUsForm = true,- UseSystemEmailForContactUsForm = true,- SitemapEnabled = true,- SitemapIncludeCategories = true,- SitemapIncludeBrands = true,- SitemapIncludeProducts = false,- PopupForTermsOfServiceLinks = true,- AllowToSelectStore = false- });- await _settingService.SaveSetting(new SystemSettings {- DeleteGuestTaskOlderThanMinutes = 1440- });- await _settingService.SaveSetting(new SecuritySettings {- AdminAreaAllowedIpAddresses = null- });- await _settingService.SaveSetting(new MediaSettings {- BlogThumbPictureSize = 450,- ProductThumbPictureSize = 415,- ProductDetailsPictureSize = 800,- ProductThumbPictureSizeOnProductDetailsPage = 100,- AssociatedProductPictureSize = 220,- CategoryThumbPictureSize = 450,- BrandThumbPictureSize = 420,- CollectionThumbPictureSize = 420,- VendorThumbPictureSize = 450,- CourseThumbPictureSize = 200,- LessonThumbPictureSize = 64,- CartThumbPictureSize = 80,- MiniCartThumbPictureSize = 100,- AddToCartThumbPictureSize = 200,- AutoCompleteSearchThumbPictureSize = 50,- ImageSquarePictureSize = 32,- MaximumImageSize = 1980,- ImageQuality = 100,- DefaultPictureZoomEnabled = true,- AllowedFileTypes = ".gif, .jpg, .jpeg, .png, .bmp, .webp",- });-- await _settingService.SaveSetting(new StorageSettings {- PictureStoreInDb = true- });-- await _settingService.SaveSetting(new SeoSettings {- PageTitleSeparator = ". ",- PageTitleSeoAdjustment = true,- DefaultTitle = "Your store",- DefaultMetaKeywords = "",- DefaultMetaDescription = "",- GenerateProductMetaDescription = true,- ConvertNonWesternChars = false,- SeoCharConversion = "ą:a;ę:e;ó:o;ć:c;ł:l;ś:s;ź:z;ż:z",- AllowUnicodeCharsInUrls = true,- CanonicalUrlsEnabled = false,- TwitterMetaTags = true,- OpenGraphMetaTags = true,- ReservedEntityUrlSlugs = [- "admin",- "install",- "recentlyviewedproducts",- "newproducts",- "compareproducts",- "clearcomparelist",- "setproductreviewhelpfulness",- "login",- "register",- "logout",- "cart",- "wishlist",- "emailwishlist",- "checkout",- "onepagecheckout",- "contactus",- "passwordrecovery",- "subscribenewsletter",- "blog",- "knowledgebase",- "news",- "sitemap",- "search",- "config",- "cookieaccept",- "access-denied",- "page-not-found",- "home",- "con",- "lpt1",- "lpt2",- "lpt3",- "lpt4",- "lpt5",- "lpt6",- "lpt7",- "lpt8",- "lpt9",- "com1",- "com2",- "com3",- "com4",- "com5",- "com6",- "com7",- "com8",- "com9",- "null",- "prn",- "aux"- ]- });-- await _settingService.SaveSetting(new AdminAreaSettings {- DefaultGridPageSize = 15,- GridPageSizes = "10, 15, 20, 50, 100",- UseIsoDateTimeConverterInJson = true,- HideStoreColumn = true- });-- await _settingService.SaveSetting(new CatalogSettings {- AllowViewUnpublishedProductPage = true,- DisplayDiscontinuedMessageForUnpublishedProducts = true,- PublishBackProductWhenCancellingOrders = false,- ShowSkuOnProductDetailsPage = false,- ShowSkuOnCatalogPages = false,- ShowMpn = false,- ShowGtin = false,- ShowFreeShippingNotification = true,- AllowProductSorting = true,- AllowProductViewModeChanging = true,- DefaultViewMode = "grid",- ShowProductsFromSubcategories = true,- ShowCategoryProductNumber = false,- ShowCategoryProductNumberIncludingSubcategories = false,- CategoryBreadcrumbEnabled = true,- ShowShareButton = false,- PageShareCode = "<!-- AddThis Button BEGIN --><div class=\"addthis_inline_share_toolbox\"></div><script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5bbf4b026e74abf6\"></script><!-- AddThis Button END -->",- ProductReviewsMustBeApproved = false,- DefaultProductRatingValue = 5,- AllowAnonymousUsersToReviewProduct = false,- FilterProductRating = "4.6,4.7,4.8,4.9,5",- ProductReviewPossibleOnlyAfterPurchasing = false,- ProductReviewPossibleOnlyOnce = false,- NotifyStoreOwnerAboutNewProductReviews = false,- EmailAFriendEnabled = true,- AskQuestionOnProduct = true,- AllowAnonymousUsersToEmailAFriend = false,- RecentlyViewedProductsNumber = 3,- RecentlyViewedProductsEnabled = true,- RecommendedProductsEnabled = false,- SuggestedProductsEnabled = false,- SuggestedProductsNumber = 6,- PersonalizedProductsEnabled = false,- PersonalizedProductsNumber = 6,- NewProductsNumber = 6,- NewProductsEnabled = true,- NewProductsOnHomePage = false,- NewProductsNumberOnHomePage = 6,- CompareProductsEnabled = true,- CompareProductsNumber = 4,- ProductSearchAutoCompleteEnabled = true,- ProductSearchAutoCompleteNumberOfProducts = 10,- ProductSearchTermMinimumLength = 3,- ShowProductImagesInSearchAutoComplete = true,- ShowBestsellersOnHomepage = false,- NumberOfBestsellersOnHomepage = 4,- BestsellersFromReports = false,- PeriodBestsellers = 6,- NumberOfReview = 10,- SearchPageProductsPerPage = 6,- SearchPageAllowCustomersToSelectPageSize = true,- SearchPagePageSizeOptions = "6, 3, 9, 18",- ProductsAlsoPurchasedEnabled = true,- ProductsAlsoPurchasedNumber = 3,- NumberOfProductTags = 15,- ProductsByTagPageSize = 6,- IncludeShortDescriptionInCompareProducts = false,- IncludeFullDescriptionInCompareProducts = false,- IncludeFeaturedProductsInNormalLists = false,- DisplayTierPricesWithDiscounts = true,- IgnoreDiscounts = false,- IgnoreFeaturedProducts = false,- IgnoreFilterableSpecAttributeOption = false,- IgnoreFilterableAvailableStartEndDateTime = true,- CustomerProductPrice = false,- ProductsByTagAllowCustomersToSelectPageSize = true,- ProductsByTagPageSizeOptions = "6, 3, 9, 18",- CollectionsBlockItemsToDisplay = 2,- DefaultCategoryPageSizeOptions = "6, 3, 9",- DefaultCollectionPageSize = 6,- LimitOfFeaturedProducts = 30,- SecondPictureOnCatalogPages = true- });-- await _settingService.SaveSetting(new LanguageSettings {- DefaultAdminLanguageId = _languageRepository.Table.Single(l => l.Name == "English").Id,- AutomaticallyDetectLanguage = false,- IgnoreRtlPropertyForAdminArea = false- });-- await _settingService.SaveSetting(new CustomerSettings {- UsernamesEnabled = false,- CheckUsernameAvailabilityEnabled = false,- AllowUsersToChangeUsernames = false,- DefaultPasswordFormat = PasswordFormat.Hashed,- HashedPasswordFormat = HashedPasswordFormat.SHA1,- PasswordRegularExpression = "^.{6,}$",- PasswordRecoveryLinkDaysValid = 7,- PasswordLifetime = 90,- FailedPasswordAllowedAttempts = 0,- FailedPasswordLockoutMinutes = 30,- UserRegistrationType = UserRegistrationType.Standard,- NotifyNewCustomerRegistration = false,- HideDownloadableProductsTab = true,- HideReviewsTab = false,- HideCoursesTab = true,- HideSubAccountsTab = true,- HideOutOfStockSubscriptionsTab = false,- HideAuctionsTab = true,- HideNotesTab = true,- HideDocumentsTab = true,- DownloadableProductsValidateUser = true,- CustomerNameFormat = CustomerNameFormat.FirstName,- GenderEnabled = false,- GeoEnabled = false,- DateOfBirthEnabled = false,- DateOfBirthRequired = false,- DateOfBirthMinimumAge = 0,- CompanyEnabled = false,- StreetAddressEnabled = false,- StreetAddress2Enabled = false,- ZipPostalCodeEnabled = false,- CityEnabled = false,- CountryEnabled = false,- CountryRequired = false,- StateProvinceEnabled = false,- StateProvinceRequired = false,- PhoneEnabled = false,- FaxEnabled = false,- AcceptPrivacyPolicyEnabled = false,- NewsletterEnabled = true,- NewsletterTickedByDefault = true,- HideNewsletterBlock = false,- RegistrationFreeShipping = false,- NewsletterBlockAllowToUnsubscribe = false,- OnlineCustomerMinutes = 20,- OnlineShoppingCartMinutes = 60,- StoreLastVisitedPage = false,- AllowUsersToDeleteAccount = false,- AllowUsersToExportData = false,- TwoFactorAuthenticationEnabled = false- });-- await _settingService.SaveSetting(new AddressSettings {- NameEnabled = false,- CompanyEnabled = true,- StreetAddressEnabled = true,- StreetAddressRequired = true,- StreetAddress2Enabled = true,- ZipPostalCodeEnabled = true,- ZipPostalCodeRequired = true,- CityEnabled = true,- CityRequired = true,- CountryEnabled = true,- StateProvinceEnabled = true,- PhoneEnabled = true,- PhoneRequired = true,- FaxEnabled = false,- NoteEnabled = false- });-- await _settingService.SaveSetting(new StoreInformationSettings {- LogoPictureId = storePictureId,- StoreClosed = false,- DefaultStoreTheme = "Default",- AllowCustomerToSelectTheme = false,- DisplayCookieInformation = false,- FacebookLink = "https://www.facebook.com/grandnodecom",- TwitterLink = "https://twitter.com/grandnode",- YoutubeLink = "http://www.youtube.com/user/grandnode",- InstagramLink = "https://www.instagram.com/grandnode/",- LinkedInLink = "https://www.linkedin.com/company/grandnode.com/",- PinterestLink = "",- VoiceNavigation = false- });-- await _settingService.SaveSetting(new LoyaltyPointsSettings {- Enabled = true,- ExchangeRate = 1,- PointsForRegistration = 0,- PointsForPurchases_Amount = 10,- PointsForPurchases_Points = 1,- PointsForPurchases_Awarded = (int)OrderStatusSystem.Complete,- ReduceLoyaltyPointsAfterCancelOrder = true,- DisplayHowMuchWillBeEarned = true,- PointsAccumulatedForAllStores = true- });-- await _settingService.SaveSetting(new CurrencySettings {- PrimaryStoreCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id,- PrimaryExchangeRateCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id,- ActiveExchangeRateProviderSystemName = "CurrencyExchange.MoneyConverter",- AutoUpdateEnabled = false- });-- await _settingService.SaveSetting(new MeasureSettings {- BaseDimensionId = _measureDimensionRepository.Table.Single(m => m.SystemKeyword == "centimetres").Id,- BaseWeightId = _measureWeightRepository.Table.Single(m => m.SystemKeyword == "lb").Id- });-- await _settingService.SaveSetting(new ShoppingCartSettings {- DisplayCartAfterAddingProduct = false,- DisplayWishlistAfterAddingProduct = false,- MaximumShoppingCartItems = 1000,- MaximumWishlistItems = 1000,- AllowOutOfStockItemsToBeAddedToWishlist = false,- MoveItemsFromWishlistToCart = true,- ShowProductImagesOnShoppingCart = true,- ShowProductImagesOnWishList = true,- ShowDiscountBox = true,- ShowGiftVoucherBox = true,- CrossSellsNumber = 4,- EmailWishlistEnabled = true,- AllowAnonymousUsersToEmailWishlist = false,- MiniShoppingCartEnabled = true,- ShowImagesInsidebarCart = true,- MiniCartProductNumber = 5,- RoundPrices = true,- GroupTierPrices = false,- AllowCartItemEditing = true,- AllowOnHoldCart = true- });-- await _settingService.SaveSetting(new OrderSettings {- IsReOrderAllowed = true,- MinOrderSubtotalAmount = 0,- MinOrderSubtotalAmountIncludingTax = false,- MinOrderTotalAmount = 0,- AnonymousCheckoutAllowed = true,- TermsOfServiceOnShoppingCartPage = true,- TermsOfServiceOnOrderConfirmPage = false,- DisableOrderCompletedPage = false,- AttachPdfInvoiceToOrderPlacedEmail = false,- AttachPdfInvoiceToOrderCompletedEmail = false,- AttachPdfInvoiceToOrderPaidEmail = false,- MerchandiseReturnsEnabled = true,- MerchandiseReturns_AllowToSpecifyPickupAddress = false,- MerchandiseReturns_AllowToSpecifyPickupDate = false,- MerchandiseReturns_PickupDateRequired = false,- NumberOfDaysMerchandiseReturnAvailable = 365,- MinimumOrderPlacementInterval = 30,- DeactivateGiftVouchersAfterDeletingOrder = true,- DeactivateGiftVouchersAfterCancelOrder = true,- GiftVouchers_Activated_OrderStatusId = 30,- CompleteOrderWhenDelivered = true,- UserCanCancelUnpaidOrder = false,- LengthCode = 8,- PageSize = 10- });-- await _settingService.SaveSetting(new ShippingSettings {- AllowPickUpInStore = true,- FreeShippingOverXEnabled = false,- FreeShippingOverXValue = 0,- FreeShippingOverXIncludingTax = false,- EstimateShippingEnabled = false,- DisplayShipmentEventsToCustomers = false,- DisplayShipmentEventsToStoreOwner = false,- SkipShippingMethodSelectionIfOnlyOne = false- });-- await _settingService.SaveSetting(new ShippingProviderSettings {- ActiveSystemNames = ["Shipping.FixedRate"]- });-- await _settingService.SaveSetting(new PaymentSettings {- ActivePaymentProviderSystemNames = [- "Payments.CashOnDelivery",- "Payments.StripeCheckout",- "Payments.BrainTree"- ],- AllowRePostingPayments = true,- SkipPaymentIfOnlyOne = true,- ShowPaymentDescriptions = true,- SkipPaymentInfo = false- });-- await _settingService.SaveSetting(new TaxSettings {- TaxBasedOn = TaxBasedOn.BillingAddress,- TaxDisplayType = TaxDisplayType.ExcludingTax,- DisplayTaxRates = false,- PricesIncludeTax = false,- CalculateRoundPrice = 2,- MidpointRounding = MidpointRounding.ToEven,- AllowCustomersToSelectTaxDisplayType = false,- ForceTaxExclusionFromOrderSubtotal = false,- HideZeroTax = false,- HideTaxInOrderSummary = false,- DefaultTaxCategoryId = "",- ShippingIsTaxable = false,- ShippingPriceIncludesTax = false,- ShippingTaxCategoryId = "",- PaymentMethodAdditionalFeeIsTaxable = false,- PaymentMethodAdditionalFeeIncludesTax = false,- PaymentMethodAdditionalFeeTaxCategoryId = "",- EuVatEnabled = false,- EuVatShopCountryId = "",- EuVatAllowVatExemption = true,- EuVatUseWebService = false,- EuVatAssumeValid = false- });-- await _settingService.SaveSetting(new TaxProviderSettings {- ActiveTaxProviderSystemName = "Tax.FixedRate"- });-- await _settingService.SaveSetting(new DateTimeSettings {- DefaultStoreTimeZoneId = ""- });-- await _settingService.SaveSetting(new BlogSettings {- Enabled = true,- PostsPageSize = 10,- AllowNotRegisteredUsersToLeaveComments = false,- NotifyAboutNewBlogComments = false,- NumberOfTags = 15,- ShowBlogOnHomePage = false,- HomePageBlogCount = 3,- MaxTextSizeHomePage = 200- });-- await _settingService.SaveSetting(new KnowledgebaseSettings {- Enabled = false,- AllowNotRegisteredUsersToLeaveComments = false,- NotifyAboutNewArticleComments = false- });-- await _settingService.SaveSetting(new PushNotificationsSettings {- Enabled = false,- AllowGuestNotifications = true- });-- await _settingService.SaveSetting(new AdminSearchSettings {- BlogsDisplayOrder = 0,- CategoriesDisplayOrder = 0,- CustomersDisplayOrder = 0,- CollectionsDisplayOrder = 0,- MaxSearchResultsCount = 10,- MinSearchTermLength = 3,- NewsDisplayOrder = 0,- OrdersDisplayOrder = 0,- ProductsDisplayOrder = 0,- SearchInBlogs = true,- SearchInCategories = true,- SearchInCustomers = true,- SearchInCollections = true,- SearchInNews = true,- SearchInOrders = true,- SearchInProducts = true,- SearchInPages = true,- PagesDisplayOrder = 0,- SearchInMenu = true,- MenuDisplayOrder = -1,- CategorySizeLimit = 100,- BrandSizeLimit = 100,- CollectionSizeLimit = 100,- VendorSizeLimit = 100,- CustomerGroupSizeLimit = 100- });-- await _settingService.SaveSetting(new NewsSettings {- Enabled = true,- AllowNotRegisteredUsersToLeaveComments = false,- NotifyAboutNewNewsComments = false,- ShowNewsOnMainPage = true,- MainPageNewsCount = 3,- NewsArchivePageSize = 10- });-- await _settingService.SaveSetting(new VendorSettings {- DefaultVendorPageSizeOptions = "6, 3, 9",- VendorsBlockItemsToDisplay = 0,- ShowVendorOnProductDetailsPage = true,- AllowCustomersToContactVendors = true,- AllowCustomersToApplyForVendorAccount = false,- AllowAnonymousUsersToReviewVendor = false,- DefaultVendorRatingValue = 5,- NumberOfReview = 10,- VendorReviewsMustBeApproved = true,- VendorReviewPossibleOnlyAfterPurchasing = true,- NotifyVendorAboutNewVendorReviews = true- });-- var eaGeneral = _emailAccountRepository.Table.FirstOrDefault();- if (eaGeneral == null)- throw new Exception("Default email account cannot be loaded");- await _settingService.SaveSetting(new EmailAccountSettings {- DefaultEmailAccountId = eaGeneral.Id- });-- await _settingService.SaveSetting(new WidgetSettings {- ActiveWidgetSystemNames = ["Widgets.Slider"]- });- }+ var _settingService = _serviceProvider.GetRequiredService<ISettingService>();+ var _pictureService = _serviceProvider.GetRequiredService<IPictureService>();++ var path = Path.Combine(_hostingEnvironment.WebRootPath, "logo.png");++ var storePictureId = (await _pictureService.InsertPicture(File.ReadAllBytes(path), "image/png", "Logo")).Id;++ await _settingService.SaveSetting(new MenuItemSettings {+ DisplayHomePageMenu = !installSampleData,+ DisplayNewProductsMenu = true,+ DisplaySearchMenu = !installSampleData,+ DisplayCustomerMenu = !installSampleData,+ DisplayBlogMenu = true,+ DisplayContactUsMenu = true+ });++ await _settingService.SaveSetting(new PdfSettings {+ LogoPictureId = "",+ InvoiceHeaderText = null,+ InvoiceFooterText = null+ });++ await _settingService.SaveSetting(new CommonSettings {+ StoreInDatabaseContactUsForm = true,+ UseSystemEmailForContactUsForm = true,+ SitemapEnabled = true,+ SitemapIncludeCategories = true,+ SitemapIncludeBrands = true,+ SitemapIncludeProducts = false,+ PopupForTermsOfServiceLinks = true,+ AllowToSelectStore = false+ });+ await _settingService.SaveSetting(new SystemSettings {+ DeleteGuestTaskOlderThanMinutes = 1440+ });+ await _settingService.SaveSetting(new SecuritySettings {+ AdminAreaAllowedIpAddresses = null+ });+ await _settingService.SaveSetting(new MediaSettings {+ BlogThumbPictureSize = 450,+ ProductThumbPictureSize = 415,+ ProductDetailsPictureSize = 800,+ ProductThumbPictureSizeOnProductDetailsPage = 100,+ AssociatedProductPictureSize = 220,+ CategoryThumbPictureSize = 450,+ BrandThumbPictureSize = 420,+ CollectionThumbPictureSize = 420,+ VendorThumbPictureSize = 450,+ CourseThumbPictureSize = 200,+ LessonThumbPictureSize = 64,+ CartThumbPictureSize = 80,+ MiniCartThumbPictureSize = 100,+ AddToCartThumbPictureSize = 200,+ AutoCompleteSearchThumbPictureSize = 50,+ ImageSquarePictureSize = 32,+ MaximumImageSize = 1980,+ ImageQuality = 100,+ DefaultPictureZoomEnabled = true,+ AllowedFileTypes = ".gif, .jpg, .jpeg, .png, .bmp, .webp"+ });++ await _settingService.SaveSetting(new StorageSettings {+ PictureStoreInDb = true+ });++ await _settingService.SaveSetting(new SeoSettings {+ PageTitleSeparator = ". ",+ PageTitleSeoAdjustment = true,+ DefaultTitle = "Your store",+ DefaultMetaKeywords = "",+ DefaultMetaDescription = "",+ GenerateProductMetaDescription = true,+ ConvertNonWesternChars = false,+ SeoCharConversion = "ą:a;ę:e;ó:o;ć:c;ł:l;ś:s;ź:z;ż:z",+ AllowUnicodeCharsInUrls = true,+ CanonicalUrlsEnabled = false,+ TwitterMetaTags = true,+ OpenGraphMetaTags = true,+ ReservedEntityUrlSlugs = [+ "admin",+ "install",+ "recentlyviewedproducts",+ "newproducts",+ "compareproducts",+ "clearcomparelist",+ "setproductreviewhelpfulness",+ "login",+ "register",+ "logout",+ "cart",+ "wishlist",+ "emailwishlist",+ "checkout",+ "onepagecheckout",+ "contactus",+ "passwordrecovery",+ "subscribenewsletter",+ "blog",+ "knowledgebase",+ "news",+ "sitemap",+ "search",+ "config",+ "cookieaccept",+ "access-denied",+ "page-not-found",+ "home",+ "con",+ "lpt1",+ "lpt2",+ "lpt3",+ "lpt4",+ "lpt5",+ "lpt6",+ "lpt7",+ "lpt8",+ "lpt9",+ "com1",+ "com2",+ "com3",+ "com4",+ "com5",+ "com6",+ "com7",+ "com8",+ "com9",+ "null",+ "prn",+ "aux"+ ]+ });++ await _settingService.SaveSetting(new AdminAreaSettings {+ DefaultGridPageSize = 15,+ GridPageSizes = "10, 15, 20, 50, 100",+ UseIsoDateTimeConverterInJson = true,+ HideStoreColumn = true+ });++ await _settingService.SaveSetting(new CatalogSettings {+ AllowViewUnpublishedProductPage = true,+ DisplayDiscontinuedMessageForUnpublishedProducts = true,+ PublishBackProductWhenCancellingOrders = false,+ ShowSkuOnProductDetailsPage = false,+ ShowSkuOnCatalogPages = false,+ ShowMpn = false,+ ShowGtin = false,+ ShowFreeShippingNotification = true,+ AllowProductSorting = true,+ AllowProductViewModeChanging = true,+ DefaultViewMode = "grid",+ ShowProductsFromSubcategories = true,+ ShowCategoryProductNumber = false,+ ShowCategoryProductNumberIncludingSubcategories = false,+ CategoryBreadcrumbEnabled = true,+ ShowShareButton = false,+ PageShareCode =+ "<!-- AddThis Button BEGIN --><div class=\"addthis_inline_share_toolbox\"></div><script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5bbf4b026e74abf6\"></script><!-- AddThis Button END -->",+ ProductReviewsMustBeApproved = false,+ DefaultProductRatingValue = 5,+ AllowAnonymousUsersToReviewProduct = false,+ FilterProductRating = "4.6,4.7,4.8,4.9,5",+ ProductReviewPossibleOnlyAfterPurchasing = false,+ ProductReviewPossibleOnlyOnce = false,+ NotifyStoreOwnerAboutNewProductReviews = false,+ EmailAFriendEnabled = true,+ AskQuestionOnProduct = true,+ AllowAnonymousUsersToEmailAFriend = false,+ RecentlyViewedProductsNumber = 3,+ RecentlyViewedProductsEnabled = true,+ RecommendedProductsEnabled = false,+ SuggestedProductsEnabled = false,+ SuggestedProductsNumber = 6,+ PersonalizedProductsEnabled = false,+ PersonalizedProductsNumber = 6,+ NewProductsNumber = 6,+ NewProductsEnabled = true,+ NewProductsOnHomePage = false,+ NewProductsNumberOnHomePage = 6,+ CompareProductsEnabled = true,+ CompareProductsNumber = 4,+ ProductSearchAutoCompleteEnabled = true,+ ProductSearchAutoCompleteNumberOfProducts = 10,+ ProductSearchTermMinimumLength = 3,+ ShowProductImagesInSearchAutoComplete = true,+ ShowBestsellersOnHomepage = false,+ NumberOfBestsellersOnHomepage = 4,+ BestsellersFromReports = false,+ PeriodBestsellers = 6,+ NumberOfReview = 10,+ SearchPageProductsPerPage = 6,+ SearchPageAllowCustomersToSelectPageSize = true,+ SearchPagePageSizeOptions = "6, 3, 9, 18",+ ProductsAlsoPurchasedEnabled = true,+ ProductsAlsoPurchasedNumber = 3,+ NumberOfProductTags = 15,+ ProductsByTagPageSize = 6,+ IncludeShortDescriptionInCompareProducts = false,+ IncludeFullDescriptionInCompareProducts = false,+ IncludeFeaturedProductsInNormalLists = false,+ DisplayTierPricesWithDiscounts = true,+ IgnoreDiscounts = false,+ IgnoreFeaturedProducts = false,+ IgnoreFilterableSpecAttributeOption = false,+ IgnoreFilterableAvailableStartEndDateTime = true,+ CustomerProductPrice = false,+ ProductsByTagAllowCustomersToSelectPageSize = true,+ ProductsByTagPageSizeOptions = "6, 3, 9, 18",+ CollectionsBlockItemsToDisplay = 2,+ DefaultCategoryPageSizeOptions = "6, 3, 9",+ DefaultCollectionPageSize = 6,+ LimitOfFeaturedProducts = 30,+ SecondPictureOnCatalogPages = true+ });++ await _settingService.SaveSetting(new LanguageSettings {+ DefaultAdminLanguageId = _languageRepository.Table.Single(l => l.Name == "English").Id,+ AutomaticallyDetectLanguage = false,+ IgnoreRtlPropertyForAdminArea = false+ });++ await _settingService.SaveSetting(new CustomerSettings {+ UsernamesEnabled = false,+ CheckUsernameAvailabilityEnabled = false,+ AllowUsersToChangeUsernames = false,+ DefaultPasswordFormat = PasswordFormat.Hashed,+ HashedPasswordFormat = HashedPasswordFormat.SHA1,+ PasswordRegularExpression = "^.{6,}$",+ PasswordRecoveryLinkDaysValid = 7,+ PasswordLifetime = 90,+ FailedPasswordAllowedAttempts = 0,+ FailedPasswordLockoutMinutes = 30,+ UserRegistrationType = UserRegistrationType.Standard,+ NotifyNewCustomerRegistration = false,+ HideDownloadableProductsTab = true,+ HideReviewsTab = false,+ HideCoursesTab = true,+ HideSubAccountsTab = true,+ HideOutOfStockSubscriptionsTab = false,+ HideAuctionsTab = true,+ HideNotesTab = true,+ HideDocumentsTab = true,+ DownloadableProductsValidateUser = true,+ CustomerNameFormat = CustomerNameFormat.FirstName,+ GenderEnabled = false,+ GeoEnabled = false,+ DateOfBirthEnabled = false,+ DateOfBirthRequired = false,+ DateOfBirthMinimumAge = 0,+ CompanyEnabled = false,+ StreetAddressEnabled = false,+ StreetAddress2Enabled = false,+ ZipPostalCodeEnabled = false,+ CityEnabled = false,+ CountryEnabled = false,+ CountryRequired = false,+ StateProvinceEnabled = false,+ StateProvinceRequired = false,+ PhoneEnabled = false,+ FaxEnabled = false,+ AcceptPrivacyPolicyEnabled = false,+ NewsletterEnabled = true,+ NewsletterTickedByDefault = true,+ HideNewsletterBlock = false,+ RegistrationFreeShipping = false,+ NewsletterBlockAllowToUnsubscribe = false,+ OnlineCustomerMinutes = 20,+ OnlineShoppingCartMinutes = 60,+ StoreLastVisitedPage = false,+ AllowUsersToDeleteAccount = false,+ AllowUsersToExportData = false,+ TwoFactorAuthenticationEnabled = false+ });++ await _settingService.SaveSetting(new AddressSettings {+ NameEnabled = false,+ CompanyEnabled = true,+ StreetAddressEnabled = true,+ StreetAddressRequired = true,+ StreetAddress2Enabled = true,+ ZipPostalCodeEnabled = true,+ ZipPostalCodeRequired = true,+ CityEnabled = true,+ CityRequired = true,+ CountryEnabled = true,+ StateProvinceEnabled = true,+ PhoneEnabled = true,+ PhoneRequired = true,+ FaxEnabled = false,+ NoteEnabled = false+ });++ await _settingService.SaveSetting(new StoreInformationSettings {+ LogoPictureId = storePictureId,+ StoreClosed = false,+ DefaultStoreTheme = "Default",+ AllowCustomerToSelectTheme = false,+ DisplayCookieInformation = false,+ FacebookLink = "https://www.facebook.com/grandnodecom",+ TwitterLink = "https://twitter.com/grandnode",+ YoutubeLink = "http://www.youtube.com/user/grandnode",+ InstagramLink = "https://www.instagram.com/grandnode/",+ LinkedInLink = "https://www.linkedin.com/company/grandnode.com/",+ PinterestLink = "",+ VoiceNavigation = false+ });++ await _settingService.SaveSetting(new LoyaltyPointsSettings {+ Enabled = true,+ ExchangeRate = 1,+ PointsForRegistration = 0,+ PointsForPurchases_Amount = 10,+ PointsForPurchases_Points = 1,+ PointsForPurchases_Awarded = (int)OrderStatusSystem.Complete,+ ReduceLoyaltyPointsAfterCancelOrder = true,+ DisplayHowMuchWillBeEarned = true,+ PointsAccumulatedForAllStores = true+ });++ await _settingService.SaveSetting(new CurrencySettings {+ PrimaryStoreCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id,+ PrimaryExchangeRateCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id,+ ActiveExchangeRateProviderSystemName = "CurrencyExchange.MoneyConverter",+ AutoUpdateEnabled = false+ });++ await _settingService.SaveSetting(new MeasureSettings {+ BaseDimensionId = _measureDimensionRepository.Table.Single(m => m.SystemKeyword == "centimetres").Id,+ BaseWeightId = _measureWeightRepository.Table.Single(m => m.SystemKeyword == "lb").Id+ });++ await _settingService.SaveSetting(new ShoppingCartSettings {+ DisplayCartAfterAddingProduct = false,+ DisplayWishlistAfterAddingProduct = false,+ MaximumShoppingCartItems = 1000,+ MaximumWishlistItems = 1000,+ AllowOutOfStockItemsToBeAddedToWishlist = false,+ MoveItemsFromWishlistToCart = true,+ ShowProductImagesOnShoppingCart = true,+ ShowProductImagesOnWishList = true,+ ShowDiscountBox = true,+ ShowGiftVoucherBox = true,+ CrossSellsNumber = 4,+ EmailWishlistEnabled = true,+ AllowAnonymousUsersToEmailWishlist = false,+ MiniShoppingCartEnabled = true,+ ShowImagesInsidebarCart = true,+ MiniCartProductNumber = 5,+ RoundPrices = true,+ GroupTierPrices = false,+ AllowCartItemEditing = true,+ AllowOnHoldCart = true+ });++ await _settingService.SaveSetting(new OrderSettings {+ IsReOrderAllowed = true,+ MinOrderSubtotalAmount = 0,+ MinOrderSubtotalAmountIncludingTax = false,+ MinOrderTotalAmount = 0,+ AnonymousCheckoutAllowed = true,+ TermsOfServiceOnShoppingCartPage = true,+ TermsOfServiceOnOrderConfirmPage = false,+ DisableOrderCompletedPage = false,+ AttachPdfInvoiceToOrderPlacedEmail = false,+ AttachPdfInvoiceToOrderCompletedEmail = false,+ AttachPdfInvoiceToOrderPaidEmail = false,+ MerchandiseReturnsEnabled = true,+ MerchandiseReturns_AllowToSpecifyPickupAddress = false,+ MerchandiseReturns_AllowToSpecifyPickupDate = false,+ MerchandiseReturns_PickupDateRequired = false,+ NumberOfDaysMerchandiseReturnAvailable = 365,+ MinimumOrderPlacementInterval = 30,+ DeactivateGiftVouchersAfterDeletingOrder = true,+ DeactivateGiftVouchersAfterCancelOrder = true,+ GiftVouchers_Activated_OrderStatusId = 30,+ CompleteOrderWhenDelivered = true,+ UserCanCancelUnpaidOrder = false,+ LengthCode = 8,+ PageSize = 10+ });++ await _settingService.SaveSetting(new ShippingSettings {+ AllowPickUpInStore = true,+ FreeShippingOverXEnabled = false,+ FreeShippingOverXValue = 0,+ FreeShippingOverXIncludingTax = false,+ EstimateShippingEnabled = false,+ DisplayShipmentEventsToCustomers = false,+ DisplayShipmentEventsToStoreOwner = false,+ SkipShippingMethodSelectionIfOnlyOne = false+ });++ await _settingService.SaveSetting(new ShippingProviderSettings {+ ActiveSystemNames = ["Shipping.FixedRate"]+ });++ await _settingService.SaveSetting(new PaymentSettings {+ ActivePaymentProviderSystemNames = [+ "Payments.CashOnDelivery",+ "Payments.StripeCheckout",+ "Payments.BrainTree"+ ],+ AllowRePostingPayments = true,+ SkipPaymentIfOnlyOne = true,+ ShowPaymentDescriptions = true,+ SkipPaymentInfo = false+ });++ await _settingService.SaveSetting(new TaxSettings {+ TaxBasedOn = TaxBasedOn.BillingAddress,+ TaxDisplayType = TaxDisplayType.ExcludingTax,+ DisplayTaxRates = false,+ PricesIncludeTax = false,+ CalculateRoundPrice = 2,+ MidpointRounding = MidpointRounding.ToEven,+ AllowCustomersToSelectTaxDisplayType = false,+ ForceTaxExclusionFromOrderSubtotal = false,+ HideZeroTax = false,+ HideTaxInOrderSummary = false,+ DefaultTaxCategoryId = "",+ ShippingIsTaxable = false,+ ShippingPriceIncludesTax = false,+ ShippingTaxCategoryId = "",+ PaymentMethodAdditionalFeeIsTaxable = false,+ PaymentMethodAdditionalFeeIncludesTax = false,+ PaymentMethodAdditionalFeeTaxCategoryId = "",+ EuVatEnabled = false,+ EuVatShopCountryId = "",+ EuVatAllowVatExemption = true,+ EuVatUseWebService = false,+ EuVatAssumeValid = false+ });++ await _settingService.SaveSetting(new TaxProviderSettings {+ ActiveTaxProviderSystemName = "Tax.FixedRate"+ });++ await _settingService.SaveSetting(new DateTimeSettings {+ DefaultStoreTimeZoneId = ""+ });++ await _settingService.SaveSetting(new BlogSettings {+ Enabled = true,+ PostsPageSize = 10,+ AllowNotRegisteredUsersToLeaveComments = false,+ NotifyAboutNewBlogComments = false,+ NumberOfTags = 15,+ ShowBlogOnHomePage = false,+ HomePageBlogCount = 3,+ MaxTextSizeHomePage = 200+ });++ await _settingService.SaveSetting(new KnowledgebaseSettings {+ Enabled = false,+ AllowNotRegisteredUsersToLeaveComments = false,+ NotifyAboutNewArticleComments = false+ });++ await _settingService.SaveSetting(new PushNotificationsSettings {+ Enabled = false,+ AllowGuestNotifications = true+ });++ await _settingService.SaveSetting(new AdminSearchSettings {+ BlogsDisplayOrder = 0,+ CategoriesDisplayOrder = 0,+ CustomersDisplayOrder = 0,+ CollectionsDisplayOrder = 0,+ MaxSearchResultsCount = 10,+ MinSearchTermLength = 3,+ NewsDisplayOrder = 0,+ OrdersDisplayOrder = 0,+ ProductsDisplayOrder = 0,+ SearchInBlogs = true,+ SearchInCategories = true,+ SearchInCustomers = true,+ SearchInCollections = true,+ SearchInNews = true,+ SearchInOrders = true,+ SearchInProducts = true,+ SearchInPages = true,+ PagesDisplayOrder = 0,+ SearchInMenu = true,+ MenuDisplayOrder = -1,+ CategorySizeLimit = 100,+ BrandSizeLimit = 100,+ CollectionSizeLimit = 100,+ VendorSizeLimit = 100,+ CustomerGroupSizeLimit = 100+ });++ await _settingService.SaveSetting(new NewsSettings {+ Enabled = true,+ AllowNotRegisteredUsersToLeaveComments = false,+ NotifyAboutNewNewsComments = false,+ ShowNewsOnMainPage = true,+ MainPageNewsCount = 3,+ NewsArchivePageSize = 10+ });++ await _settingService.SaveSetting(new VendorSettings {+ DefaultVendorPageSizeOptions = "6, 3, 9",+ VendorsBlockItemsToDisplay = 0,+ ShowVendorOnProductDetailsPage = true,+ AllowCustomersToContactVendors = true,+ AllowCustomersToApplyForVendorAccount = false,+ AllowAnonymousUsersToReviewVendor = false,+ DefaultVendorRatingValue = 5,+ NumberOfReview = 10,+ VendorReviewsMustBeApproved = true,+ VendorReviewPossibleOnlyAfterPurchasing = true,+ NotifyVendorAboutNewVendorReviews = true+ });++ var eaGeneral = _emailAccountRepository.Table.FirstOrDefault();+ if (eaGeneral == null)+ throw new Exception("Default email account cannot be loaded");+ await _settingService.SaveSetting(new EmailAccountSettings {+ DefaultEmailAccountId = eaGeneral.Id+ });++ await _settingService.SaveSetting(new WidgetSettings {+ ActiveWidgetSystemNames = ["Widgets.Slider"]+ });}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataShippingMethods.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataShippingMethods.csindex 92cdf8847..6fc227ab0 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataShippingMethods.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataShippingMethods.cs@@ -1,34 +1,29 @@using Grand.Domain.Shipping;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallShippingMethods(){- protected virtual Task InstallShippingMethods()- {- var shippingMethods = new List<ShippingMethod>- {- new ShippingMethod- {- Name = "Ground",- Description ="Compared to other shipping methods, ground shipping is carried out closer to the earth",- DisplayOrder = 1- },- new ShippingMethod- {- Name = "Next Day Air",- Description ="The one day air shipping",- DisplayOrder = 3- },- new ShippingMethod- {- Name = "2nd Day Air",- Description ="The two day air shipping",- DisplayOrder = 3- }- };- shippingMethods.ForEach(x=>_shippingMethodRepository.Insert(x));- return Task.CompletedTask;- }+ var shippingMethods = new List<ShippingMethod> {+ new() {+ Name = "Ground",+ Description = "Compared to other shipping methods, ground shipping is carried out closer to the earth",+ DisplayOrder = 1+ },+ new() {+ Name = "Next Day Air",+ Description = "The one day air shipping",+ DisplayOrder = 3+ },+ new() {+ Name = "2nd Day Air",+ Description = "The two day air shipping",+ DisplayOrder = 3+ }+ };+ shippingMethods.ForEach(x => _shippingMethodRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataSpecificationAttributes.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataSpecificationAttributes.csindex 54557e16e..62b5f2021 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataSpecificationAttributes.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataSpecificationAttributes.cs@@ -1,130 +1,112 @@using Grand.Business.Core.Extensions;using Grand.Domain.Catalog;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallSpecificationAttributes(){- protected virtual async Task InstallSpecificationAttributes()- {- var sa1 = new SpecificationAttribute- {- Name = "Screensize",- DisplayOrder = 1,- SeName = SeoExtensions.GenerateSlug("Screensize", false, false, false)- };- await _specificationAttributeRepository.InsertAsync(sa1);+ var sa1 = new SpecificationAttribute {+ Name = "Screensize",+ DisplayOrder = 1,+ SeName = SeoExtensions.GenerateSlug("Screensize", false, false, false)+ };+ await _specificationAttributeRepository.InsertAsync(sa1);- sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "13.0''",- DisplayOrder = 2,- SeName = SeoExtensions.GenerateSlug("13.0''", false, false, false)- });- sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "13.3''",- DisplayOrder = 3,- SeName = SeoExtensions.GenerateSlug("13.3''", false, false, false)- });- sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "14.0''",- DisplayOrder = 4,- SeName = SeoExtensions.GenerateSlug("14.0''", false, false, false)- });- sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "15.0''",- DisplayOrder = 4,- SeName = SeoExtensions.GenerateSlug("15.0''", false, false, false)- });- sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "15.6''",- DisplayOrder = 5,- SeName = SeoExtensions.GenerateSlug("15.6''", false, false, false)- });- await _specificationAttributeRepository.UpdateAsync(sa1);+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "13.0''",+ DisplayOrder = 2,+ SeName = SeoExtensions.GenerateSlug("13.0''", false, false, false)+ });+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "13.3''",+ DisplayOrder = 3,+ SeName = SeoExtensions.GenerateSlug("13.3''", false, false, false)+ });+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "14.0''",+ DisplayOrder = 4,+ SeName = SeoExtensions.GenerateSlug("14.0''", false, false, false)+ });+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "15.0''",+ DisplayOrder = 4,+ SeName = SeoExtensions.GenerateSlug("15.0''", false, false, false)+ });+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "15.6''",+ DisplayOrder = 5,+ SeName = SeoExtensions.GenerateSlug("15.6''", false, false, false)+ });+ await _specificationAttributeRepository.UpdateAsync(sa1);- var sa2 = new SpecificationAttribute- {- Name = "CPU Type",- DisplayOrder = 2,- SeName = SeoExtensions.GenerateSlug("CPU Type", false, false, false)- };- await _specificationAttributeRepository.InsertAsync(sa2);+ var sa2 = new SpecificationAttribute {+ Name = "CPU Type",+ DisplayOrder = 2,+ SeName = SeoExtensions.GenerateSlug("CPU Type", false, false, false)+ };+ await _specificationAttributeRepository.InsertAsync(sa2);- sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "Intel Core i5",- DisplayOrder = 1,- SeName = SeoExtensions.GenerateSlug("Intel Core i5", false, false, false)- });+ sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "Intel Core i5",+ DisplayOrder = 1,+ SeName = SeoExtensions.GenerateSlug("Intel Core i5", false, false, false)+ });- sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "Intel Core i7",- DisplayOrder = 2,- SeName = SeoExtensions.GenerateSlug("Intel Core i7", false, false, false)- });- await _specificationAttributeRepository.UpdateAsync(sa2);+ sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "Intel Core i7",+ DisplayOrder = 2,+ SeName = SeoExtensions.GenerateSlug("Intel Core i7", false, false, false)+ });+ await _specificationAttributeRepository.UpdateAsync(sa2);- var sa3 = new SpecificationAttribute- {- Name = "Memory",- DisplayOrder = 3,- SeName = SeoExtensions.GenerateSlug("Memory", false, false, false)- };- await _specificationAttributeRepository.InsertAsync(sa3);+ var sa3 = new SpecificationAttribute {+ Name = "Memory",+ DisplayOrder = 3,+ SeName = SeoExtensions.GenerateSlug("Memory", false, false, false)+ };+ await _specificationAttributeRepository.InsertAsync(sa3);- sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "4 GB",- DisplayOrder = 1,- SeName = SeoExtensions.GenerateSlug("4 GB", false, false, false)- });- sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "8 GB",- DisplayOrder = 2,- SeName = SeoExtensions.GenerateSlug("8 GB", false, false, false)- });- sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "16 GB",- DisplayOrder = 3,- SeName = SeoExtensions.GenerateSlug("16 GB", false, false, false)- });- await _specificationAttributeRepository.UpdateAsync(sa3);+ sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "4 GB",+ DisplayOrder = 1,+ SeName = SeoExtensions.GenerateSlug("4 GB", false, false, false)+ });+ sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "8 GB",+ DisplayOrder = 2,+ SeName = SeoExtensions.GenerateSlug("8 GB", false, false, false)+ });+ sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "16 GB",+ DisplayOrder = 3,+ SeName = SeoExtensions.GenerateSlug("16 GB", false, false, false)+ });+ await _specificationAttributeRepository.UpdateAsync(sa3);- var sa4 = new SpecificationAttribute- {- Name = "Hardrive",- DisplayOrder = 5,- SeName = SeoExtensions.GenerateSlug("Hardrive", false, false, false)- };- await _specificationAttributeRepository.InsertAsync(sa4);+ var sa4 = new SpecificationAttribute {+ Name = "Hardrive",+ DisplayOrder = 5,+ SeName = SeoExtensions.GenerateSlug("Hardrive", false, false, false)+ };+ await _specificationAttributeRepository.InsertAsync(sa4);- sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "128 GB",- DisplayOrder = 7,- SeName = SeoExtensions.GenerateSlug("128 GB", false, false, false)- });- sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "500 GB",- DisplayOrder = 4,- SeName = SeoExtensions.GenerateSlug("500 GB", false, false, false)- });- sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption- {- Name = "1 TB",- DisplayOrder = 3,- SeName = SeoExtensions.GenerateSlug("1 TB", false, false, false)- });- await _specificationAttributeRepository.UpdateAsync(sa4);- }+ sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "128 GB",+ DisplayOrder = 7,+ SeName = SeoExtensions.GenerateSlug("128 GB", false, false, false)+ });+ sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "500 GB",+ DisplayOrder = 4,+ SeName = SeoExtensions.GenerateSlug("500 GB", false, false, false)+ });+ sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {+ Name = "1 TB",+ DisplayOrder = 3,+ SeName = SeoExtensions.GenerateSlug("1 TB", false, false, false)+ });+ await _specificationAttributeRepository.UpdateAsync(sa4);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataStores.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataStores.csindex ed25e5b18..cf1d94aee 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataStores.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataStores.cs@@ -1,35 +1,35 @@using Grand.Domain.Stores;using Microsoft.AspNetCore.Http;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallStores(+ string httpscheme, HostString host,+ string companyName, string companyAddress, string companyPhoneNumber, string companyEmail){- protected virtual async Task InstallStores(- string httpscheme, HostString host,- string companyName, string companyAddress, string companyPhoneNumber, string companyEmail)- {- var store =- new Store {- Name = "Your store name",- Shortcut = "Store",- Url = $"http://{host}/",- SecureUrl = $"https://{host}/",- SslEnabled = httpscheme.ToLowerInvariant() == "https",- DisplayOrder = 1,- CompanyName = companyName,- CompanyAddress = companyAddress,- CompanyPhoneNumber = companyPhoneNumber,- CompanyRegNo = null,- CompanyVat = null,- CompanyEmail = companyEmail,- CompanyHours = "Monday - Sunday / 8:00AM - 6:00PM",- Domains = new List<DomainHost> { new DomainHost { HostName = host.Value, Url = $"{httpscheme}://{host}/", Primary = true } }- };+ var store =+ new Store {+ Name = "Your store name",+ Shortcut = "Store",+ Url = $"http://{host}/",+ SecureUrl = $"https://{host}/",+ SslEnabled = httpscheme.ToLowerInvariant() == "https",+ DisplayOrder = 1,+ CompanyName = companyName,+ CompanyAddress = companyAddress,+ CompanyPhoneNumber = companyPhoneNumber,+ CompanyRegNo = null,+ CompanyVat = null,+ CompanyEmail = companyEmail,+ CompanyHours = "Monday - Sunday / 8:00AM - 6:00PM",+ Domains = new List<DomainHost>+ { new() { HostName = host.Value, Url = $"{httpscheme}://{host}/", Primary = true } }+ };- store = await _storeRepository.InsertAsync(store);+ store = await _storeRepository.InsertAsync(store);- await InstallDataRobotsTxt(store);- }+ await InstallDataRobotsTxt(store);}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataTaxCategories.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataTaxCategories.csindex 631229d0f..0c6212d04 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataTaxCategories.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataTaxCategories.cs@@ -1,41 +1,34 @@using Grand.Domain.Tax;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallTaxCategories(){- protected virtual Task InstallTaxCategories()- {- var taxCategories = new List<TaxCategory>- {- new TaxCategory- {- Name = "Lego",- DisplayOrder = 1- },- new TaxCategory- {- Name = "Electronics & Software",- DisplayOrder = 5- },- new TaxCategory- {- Name = "Downloadable Products",- DisplayOrder = 10- },- new TaxCategory- {- Name = "Balls",- DisplayOrder = 15- },- new TaxCategory- {- Name = "Apparel",- DisplayOrder = 20- }- };- taxCategories.ForEach(x=>_taxCategoryRepository.Insert(x));- return Task.CompletedTask;- }+ var taxCategories = new List<TaxCategory> {+ new() {+ Name = "Lego",+ DisplayOrder = 1+ },+ new() {+ Name = "Electronics & Software",+ DisplayOrder = 5+ },+ new() {+ Name = "Downloadable Products",+ DisplayOrder = 10+ },+ new() {+ Name = "Balls",+ DisplayOrder = 15+ },+ new() {+ Name = "Apparel",+ DisplayOrder = 20+ }+ };+ taxCategories.ForEach(x => _taxCategoryRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataVendors.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataVendors.csindex 34b03cf19..1d6ea312e 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataVendors.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataVendors.cs@@ -2,59 +2,54 @@using Grand.Domain.Seo;using Grand.Domain.Vendors;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual async Task InstallVendors(){- protected virtual async Task InstallVendors()- {- var vendors = new List<Vendor>- {- new Vendor- {- Name = "Vendor 1",- Email = "[email protected]",- Description = "Some description...",- AdminComment = "",- PictureId = "",- Active = true,- DisplayOrder = 1,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9, 18"- },- new Vendor- {- Name = "Vendor 2",- Email = "[email protected]",- Description = "Some description...",- AdminComment = "",- PictureId = "",- Active = true,- DisplayOrder = 2,- PageSize = 6,- AllowCustomersToSelectPageSize = true,- PageSizeOptions = "6, 3, 9, 18"- }- };+ var vendors = new List<Vendor> {+ new() {+ Name = "Vendor 1",+ Email = "[email protected]",+ Description = "Some description...",+ AdminComment = "",+ PictureId = "",+ Active = true,+ DisplayOrder = 1,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9, 18"+ },+ new() {+ Name = "Vendor 2",+ Email = "[email protected]",+ Description = "Some description...",+ AdminComment = "",+ PictureId = "",+ Active = true,+ DisplayOrder = 2,+ PageSize = 6,+ AllowCustomersToSelectPageSize = true,+ PageSizeOptions = "6, 3, 9, 18"+ }+ };- vendors.ForEach(x=>_vendorRepository.Insert(x));+ vendors.ForEach(x => _vendorRepository.Insert(x));- //search engine names- foreach (var vendor in vendors)- {- var seName = SeoExtensions.GenerateSlug(vendor.Name, false, false, false);- await _entityUrlRepository.InsertAsync(new EntityUrl- {- EntityId = vendor.Id,- EntityName = "Vendor",- LanguageId = "",- IsActive = true,- Slug = seName- });- vendor.SeName = seName;- await _vendorRepository.UpdateAsync(vendor);- }+ //search engine names+ foreach (var vendor in vendors)+ {+ var seName = SeoExtensions.GenerateSlug(vendor.Name, false, false, false);+ await _entityUrlRepository.InsertAsync(new EntityUrl {+ EntityId = vendor.Id,+ EntityName = "Vendor",+ LanguageId = "",+ IsActive = true,+ Slug = seName+ });+ vendor.SeName = seName;+ await _vendorRepository.UpdateAsync(vendor);}}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataWarehouses.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataWarehouses.csindex fa589d17d..356801485 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataWarehouses.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataWarehouses.cs@@ -1,51 +1,45 @@using Grand.Domain.Common;using Grand.Domain.Shipping;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService{- public partial class InstallationService+ protected virtual Task InstallWarehouses(){- protected virtual Task InstallWarehouses()- {- var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");- var warehouse1address = new Address- {- Address1 = "21 West 52nd Street",- City = "New York",- StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,- CountryId = country?.Id,- ZipPostalCode = "10021"- };+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");+ var warehouse1address = new Address {+ Address1 = "21 West 52nd Street",+ City = "New York",+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,+ CountryId = country?.Id,+ ZipPostalCode = "10021"+ };- var warehouse2address = new Address- {- Address1 = "300 South Spring Stree",- City = "Los Angeles",- StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "California")?.Id,- CountryId = country?.Id,- ZipPostalCode = "90013"- };+ var warehouse2address = new Address {+ Address1 = "300 South Spring Stree",+ City = "Los Angeles",+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "California")?.Id,+ CountryId = country?.Id,+ ZipPostalCode = "90013"+ };- var warehouses = new List<Warehouse>- {- new Warehouse- {- Code = "WHS01",- Name = "Warehouse 1",- Address = warehouse1address,- DisplayOrder = 0- },- new Warehouse- {- Code = "WHS02",- Name = "Warehouse 2",- Address = warehouse2address,- DisplayOrder = 1- }- };+ var warehouses = new List<Warehouse> {+ new() {+ Code = "WHS01",+ Name = "Warehouse 1",+ Address = warehouse1address,+ DisplayOrder = 0+ },+ new() {+ Code = "WHS02",+ Name = "Warehouse 2",+ Address = warehouse2address,+ DisplayOrder = 1+ }+ };- warehouses.ForEach(x=>_warehouseRepository.Insert(x));- return Task.CompletedTask;- }+ warehouses.ForEach(x => _warehouseRepository.Insert(x));+ return Task.CompletedTask;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs b/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.csindex 1a7dada95..2782d5489 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs@@ -4,181 +4,184 @@ using Grand.SharedKernel.Extensions;using System.Text.RegularExpressions;using System.Xml;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++/// <summary>+/// Translation service for installation process+/// </summary>+public class InstallationLocalizedService : IInstallationLocalizedService{/// <summary>- /// Translation service for installation process+ /// Available collation+ /// </summary>+ private IList<InstallationCollation> _availableCollation;++ /// <summary>+ /// Available languages/// </summary>- public class InstallationLocalizedService : IInstallationLocalizedService+ private IList<InstallationLanguage> _availableLanguages;++ /// <summary>+ /// Get locale resource value+ /// </summary>+ /// <param name="languageCode">Language code</param>+ /// <param name="resourceName">Resource name</param>+ /// <returns>Resource value</returns>+ public string GetResource(string languageCode, string resourceName){- /// <summary>- /// Available languages- /// </summary>- private IList<InstallationLanguage> _availableLanguages;-- /// <summary>- /// Available collation- /// </summary>- private IList<InstallationCollation> _availableCollation;-- /// <summary>- /// Get locale resource value- /// </summary>- /// <param name="languageCode">Language code</param>- /// <param name="resourceName">Resource name</param>- /// <returns>Resource value</returns>- public string GetResource(string languageCode, string resourceName)+ var language = GetCurrentLanguage(languageCode);+ if (language == null)+ return resourceName;+ var resourceValue = language.Resources+ .Where(r => r.Name.Equals(resourceName, StringComparison.OrdinalIgnoreCase))+ .Select(r => r.Value)+ .FirstOrDefault();++ return string.IsNullOrEmpty(resourceValue)+ ?+ //return name+ resourceName+ : resourceValue;+ }++ /// <summary>+ /// Get current language for the installation page+ /// </summary>+ /// <returns>Current language</returns>+ /// <param name="languageCode">Language Code</param>+ public virtual InstallationLanguage GetCurrentLanguage(string languageCode = default)+ {+ var availableLanguages = GetAvailableLanguages();+ if (!string.IsNullOrEmpty(languageCode)){- var language = GetCurrentLanguage(languageCode);- if (language == null)- return resourceName;- var resourceValue = language.Resources- .Where(r => r.Name.Equals(resourceName, StringComparison.OrdinalIgnoreCase))- .Select(r => r.Value)- .FirstOrDefault();-- return string.IsNullOrEmpty(resourceValue) ?- //return name- resourceName : resourceValue;+ var selectedlanguage = availableLanguages+ .FirstOrDefault(l => l.Code.Equals(languageCode, StringComparison.OrdinalIgnoreCase));+ if (selectedlanguage != null)+ return selectedlanguage;}- /// <summary>- /// Get current language for the installation page- /// </summary>- /// <returns>Current language</returns>- /// <param name="languageCode">Language Code</param>- public virtual InstallationLanguage GetCurrentLanguage(string languageCode = default)- {- var availableLanguages = GetAvailableLanguages();- if(!string.IsNullOrEmpty(languageCode))- {- var selectedlanguage = availableLanguages- .FirstOrDefault(l => l.Code.Equals(languageCode, StringComparison.OrdinalIgnoreCase));- if (selectedlanguage != null)- return selectedlanguage;- }+ //return the default one+ var language = availableLanguages.FirstOrDefault(l => l.IsDefault);+ if (language != null)+ return language;- //return the default one- var language = availableLanguages.FirstOrDefault(l => l.IsDefault);- if (language != null)- return language;+ //return any available language+ language = availableLanguages.FirstOrDefault();+ return language;+ }- //return any available language- language = availableLanguages.FirstOrDefault();- return language;- }+ /// <summary>+ /// Get a list of available languages+ /// </summary>+ /// <returns>Available installation languages</returns>+ public virtual IList<InstallationLanguage> GetAvailableLanguages()+ {+ if (_availableLanguages != null)+ return _availableLanguages;- /// <summary>- /// Get a list of available languages- /// </summary>- /// <returns>Available installation languages</returns>- public virtual IList<InstallationLanguage> GetAvailableLanguages()+ _availableLanguages = new List<InstallationLanguage>();+ foreach (var filePath in Directory.EnumerateFiles(CommonPath.MapPath("App_Data/Resources/Installation/"),+ "*.xml")){- if (_availableLanguages != null)- return _availableLanguages;+ var xmlDocument = new XmlDocument();+ xmlDocument.Load(File.OpenRead(filePath));- _availableLanguages = new List<InstallationLanguage>();- foreach (var filePath in Directory.EnumerateFiles(CommonPath.MapPath("App_Data/Resources/Installation/"), "*.xml"))+ var languageCode = "";+ var r = new Regex(Regex.Escape("installation.") + "(.*?)" + Regex.Escape(".xml"));+ var matches = r.Matches(Path.GetFileName(filePath));+ foreach (Match match in matches)+ languageCode = match.Groups[1].Value;++ var languageNode = xmlDocument.SelectSingleNode("//Language");++ if (languageNode?.Attributes == null)+ continue;++ //get language friendly name+ var languageName = languageNode.Attributes["Name"]?.InnerText.Trim();++ //is default+ var isDefaultAttribute = languageNode.Attributes["IsDefault"];+ var isDefault = isDefaultAttribute != null && Convert.ToBoolean(isDefaultAttribute.InnerText.Trim());++ //is default+ var isRightToLeftAttribute = languageNode.Attributes["IsRightToLeft"];+ var isRightToLeft = isRightToLeftAttribute != null &&+ Convert.ToBoolean(isRightToLeftAttribute.InnerText.Trim());++ //create language+ var language = new InstallationLanguage {+ Code = languageCode,+ Name = languageName,+ IsDefault = isDefault,+ IsRightToLeft = isRightToLeft+ };++ //load resources+ var resources = xmlDocument.SelectNodes("//Language/LocaleResource");+ if (resources == null)+ continue;+ foreach (XmlNode resNode in resources){- var xmlDocument = new XmlDocument();- xmlDocument.Load(File.OpenRead(filePath));-- var languageCode = "";- var r = new Regex(Regex.Escape("installation.") + "(.*?)" + Regex.Escape(".xml"));- var matches = r.Matches(Path.GetFileName(filePath));- foreach (Match match in matches)- languageCode = match.Groups[1].Value;-- var languageNode = xmlDocument.SelectSingleNode("//Language");-- if (languageNode?.Attributes == null)+ if (resNode.Attributes == null)continue;- //get language friendly name- var languageName = languageNode.Attributes["Name"]?.InnerText.Trim();-- //is default- var isDefaultAttribute = languageNode.Attributes["IsDefault"];- var isDefault = isDefaultAttribute != null && Convert.ToBoolean(isDefaultAttribute.InnerText.Trim());-- //is default- var isRightToLeftAttribute = languageNode.Attributes["IsRightToLeft"];- var isRightToLeft = isRightToLeftAttribute != null && Convert.ToBoolean(isRightToLeftAttribute.InnerText.Trim());-- //create language- var language = new InstallationLanguage {- Code = languageCode,- Name = languageName,- IsDefault = isDefault,- IsRightToLeft = isRightToLeft- };+ var resNameAttribute = resNode.Attributes["Name"];+ var resValueNode = resNode.SelectSingleNode("Value");- //load resources- var resources = xmlDocument.SelectNodes("//Language/LocaleResource");- if (resources == null)+ if (resNameAttribute == null)+ continue;+ var resourceName = resNameAttribute.Value.Trim();+ if (string.IsNullOrEmpty(resourceName))continue;- foreach (XmlNode resNode in resources)- {- if (resNode.Attributes == null)- continue;-- var resNameAttribute = resNode.Attributes["Name"];- var resValueNode = resNode.SelectSingleNode("Value");-- if (resNameAttribute == null)- continue;- var resourceName = resNameAttribute.Value.Trim();- if (string.IsNullOrEmpty(resourceName))- continue;-- if (resValueNode == null)- continue;- var resourceValue = resValueNode.InnerText.Trim();-- language.Resources.Add(new InstallationLocaleResource {- Name = resourceName,- Value = resourceValue- });- }- _availableLanguages.Add(language);- _availableLanguages = _availableLanguages.OrderBy(l => l.Name).ToList();+ if (resValueNode == null)+ continue;+ var resourceValue = resValueNode.InnerText.Trim();+ language.Resources.Add(new InstallationLocaleResource {+ Name = resourceName,+ Value = resourceValue+ });}- return _availableLanguages;++ _availableLanguages.Add(language);+ _availableLanguages = _availableLanguages.OrderBy(l => l.Name).ToList();}- /// <summary>- /// Get a list of available collactions- /// </summary>- /// <returns>Available collations mongodb</returns>- public virtual IList<InstallationCollation> GetAvailableCollations()- {- if (_availableCollation != null)- return _availableCollation;+ return _availableLanguages;+ }- _availableCollation = new List<InstallationCollation>();- var filePath = CommonPath.MapPath("App_Data/Resources/supportedcollation.xml");- var xmlDocument = new XmlDocument { XmlResolver = null };- xmlDocument.Load(File.OpenRead(filePath));+ /// <summary>+ /// Get a list of available collactions+ /// </summary>+ /// <returns>Available collations mongodb</returns>+ public virtual IList<InstallationCollation> GetAvailableCollations()+ {+ if (_availableCollation != null)+ return _availableCollation;- var collation = xmlDocument.SelectNodes("//Collations/Collation");+ _availableCollation = new List<InstallationCollation>();+ var filePath = CommonPath.MapPath("App_Data/Resources/supportedcollation.xml");+ var xmlDocument = new XmlDocument { XmlResolver = null };+ xmlDocument.Load(File.OpenRead(filePath));- foreach (XmlNode resNode in collation!)- {- var resNameAttribute = resNode.Attributes!["Name"];- var resValueNode = resNode.SelectSingleNode("Value");+ var collation = xmlDocument.SelectNodes("//Collations/Collation");- var resourceName = resNameAttribute!.Value.Trim();- var resourceValue = resValueNode!.InnerText.Trim();+ foreach (XmlNode resNode in collation!)+ {+ var resNameAttribute = resNode.Attributes!["Name"];+ var resValueNode = resNode.SelectSingleNode("Value");- _availableCollation.Add(new InstallationCollation {- Name = resourceName,- Value = resourceValue- });- }+ var resourceName = resNameAttribute!.Value.Trim();+ var resourceValue = resValueNode!.InnerText.Trim();- return _availableCollation;+ _availableCollation.Add(new InstallationCollation {+ Name = resourceName,+ Value = resourceValue+ });}++ return _availableCollation;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs b/src/Business/Grand.Business.System/Services/Installation/InstallationService.csindex 7d29fbedb..2d6f155f9 100644--- a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs+++ b/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs@@ -1,7 +1,8 @@using Grand.Business.Core.Interfaces.Customers;-using Grand.Business.Core.Utilities.Customers;using Grand.Business.Core.Interfaces.System.Installation;+using Grand.Business.Core.Utilities.Customers;using Grand.Business.Core.Utilities.System;+using Grand.Data;using Grand.Domain;using Grand.Domain.Admin;using Grand.Domain.Affiliates;@@ -11,7 +12,6 @@ using Grand.Domain.Common;using Grand.Domain.Configuration;using Grand.Domain.Courses;using Grand.Domain.Customers;-using Grand.Data;using Grand.Domain.Directory;using Grand.Domain.Discounts;using Grand.Domain.Documents;@@ -36,752 +36,963 @@ using Microsoft.AspNetCore.Hosting;using Microsoft.AspNetCore.Http;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Installation+namespace Grand.Business.System.Services.Installation;++public partial class InstallationService : IInstallationService{- public partial class InstallationService : IInstallationService+ #region Ctor++ public InstallationService(+ IServiceProvider serviceProvider,+ IWebHostEnvironment webHostEnvironment,+ IRepository<GrandNodeVersion> versionRepository,+ IRepository<AdminSiteMap> adminRepository,+ IRepository<Bid> bidRepository,+ IRepository<Affiliate> affiliateRepository,+ IRepository<CampaignHistory> campaignHistoryRepository,+ IRepository<Campaign> campaignRepository,+ IRepository<Order> orderRepository,+ IRepository<OrderNote> orderNoteRepository,+ IRepository<MerchandiseReturn> merchandiseReturnRepository,+ IRepository<MerchandiseReturnNote> merchandiseReturnNoteRepository,+ IRepository<Store> storeRepository,+ IRepository<MeasureDimension> measureDimensionRepository,+ IRepository<MeasureWeight> measureWeightRepository,+ IRepository<MeasureUnit> measureUnitRepository,+ IRepository<TaxCategory> taxCategoryRepository,+ IRepository<Language> languageRepository,+ IRepository<TranslationResource> lsrRepository,+ IRepository<Currency> currencyRepository,+ IRepository<Customer> customerRepository,+ IRepository<CustomerGroup> customerGroupRepository,+ IRepository<CustomerGroupProduct> customerGroupProductRepository,+ IRepository<CustomerProduct> customerProductRepository,+ IRepository<CustomerProductPrice> customerProductPriceRepository,+ IRepository<CustomerTagProduct> customerTagProductRepository,+ IRepository<CustomerHistoryPassword> customerHistoryPasswordRepository,+ IRepository<CustomerNote> customerNoteRepository,+ IRepository<UserApi> userapiRepository,+ IRepository<SpecificationAttribute> specificationAttributeRepository,+ IRepository<CheckoutAttribute> checkoutAttributeRepository,+ IRepository<ProductAttribute> productAttributeRepository,+ IRepository<AddressAttribute> addressAttributeRepository,+ IRepository<CustomerAttribute> customerAttributeRepository,+ IRepository<ContactAttribute> contactAttributeRepository,+ IRepository<Category> categoryRepository,+ IRepository<Brand> brandRepository,+ IRepository<Vendor> vendorRepository,+ IRepository<Collection> collectionRepository,+ IRepository<Product> productRepository,+ IRepository<ProductReservation> productReservationRepository,+ IRepository<ProductAlsoPurchased> productalsopurchasedRepository,+ IRepository<EntityUrl> entityUrlRepository,+ IRepository<EmailAccount> emailAccountRepository,+ IRepository<MessageTemplate> messageTemplateRepository,+ IRepository<Country> countryRepository,+ IRepository<Discount> discountRepository,+ IRepository<DiscountCoupon> discountCouponRepository,+ IRepository<DiscountUsageHistory> discountusageRepository,+ IRepository<BlogPost> blogPostRepository,+ IRepository<BlogCategory> blogCategoryRepository,+ IRepository<BlogComment> blogCommentRepository,+ IRepository<Page> pageRepository,+ IRepository<NewsItem> newsItemRepository,+ IRepository<NewsLetterSubscription> newslettersubscriptionRepository,+ IRepository<ShippingMethod> shippingMethodRepository,+ IRepository<DeliveryDate> deliveryDateRepository,+ IRepository<ProductTag> productTagRepository,+ IRepository<ProductReview> productReviewRepository,+ IRepository<ProductLayout> productLayoutRepository,+ IRepository<CategoryLayout> categoryLayoutRepository,+ IRepository<BrandLayout> brandLayoutRepository,+ IRepository<CollectionLayout> collectionLayoutRepository,+ IRepository<PageLayout> pageLayoutRepository,+ IRepository<ScheduleTask> scheduleTaskRepository,+ IRepository<LoyaltyPointsHistory> loyaltypointshistoryRepository,+ IRepository<SearchTerm> searchtermRepository,+ IRepository<Setting> settingRepository,+ IRepository<Shipment> shipmentRepository,+ IRepository<Warehouse> warehouseRepository,+ IRepository<PickupPoint> pickupPointsRepository,+ IRepository<Permission> permissionRepository,+ IRepository<PermissionAction> permissionAction,+ IRepository<ExternalAuthentication> externalAuthenticationRepository,+ IRepository<MerchandiseReturnReason> merchandiseReturnReasonRepository,+ IRepository<MerchandiseReturnAction> merchandiseReturnActionRepository,+ IRepository<ContactUs> contactUsRepository,+ IRepository<RecentlyViewedProduct> recentlyViewedProductRepository,+ IRepository<KnowledgebaseArticle> knowledgebaseArticleRepository,+ IRepository<KnowledgebaseCategory> knowledgebaseCategoryRepository,+ IRepository<OrderTag> orderTagRepository,+ IRepository<OrderStatus> orderStatusRepository,+ IRepository<PickupPoint> pickupPointRepository,+ IRepository<OutOfStockSubscription> outOfStockSubscriptionRepository,+ IRepository<ShipmentNote> shipmentNoteRepository,+ IRepository<PaymentTransaction> paymentTransactionRepository,+ IRepository<QueuedEmail> queuedEmailRepository,+ IRepository<GiftVoucher> giftVoucherRepository,+ IRepository<DocumentType> documentTypeRepository,+ IRepository<Document> documentRepository,+ IRepository<SalesEmployee> salesRepository,+ IRepository<VendorReview> vendorReviewRepository,+ IRepository<NewsletterCategory> newsletterCategoryRepository,+ IRepository<Course> courseRepository,+ IRepository<CourseLevel> courseLevelRepository,+ IRepository<RobotsTxt> robotsTxtRepository){- #region Fields-- private readonly IRepository<GrandNodeVersion> _versionRepository;- private readonly IRepository<AdminSiteMap> _adminRepository;- private readonly IRepository<Bid> _bidRepository;- private readonly IRepository<Affiliate> _affiliateRepository;- private readonly IRepository<CampaignHistory> _campaignHistoryRepository;- private readonly IRepository<Campaign> _campaignRepository;- private readonly IRepository<Order> _orderRepository;- private readonly IRepository<OrderNote> _orderNoteRepository;- private readonly IRepository<MerchandiseReturn> _merchandiseReturnRepository;- private readonly IRepository<MerchandiseReturnNote> _merchandiseReturnNoteRepository;- private readonly IRepository<Store> _storeRepository;- private readonly IRepository<MeasureDimension> _measureDimensionRepository;- private readonly IRepository<MeasureWeight> _measureWeightRepository;- private readonly IRepository<MeasureUnit> _measureUnitRepository;- private readonly IRepository<TaxCategory> _taxCategoryRepository;- private readonly IRepository<Language> _languageRepository;- private readonly IRepository<TranslationResource> _lsrRepository;- private readonly IRepository<Currency> _currencyRepository;- private readonly IRepository<Customer> _customerRepository;- private readonly IRepository<CustomerGroup> _customerGroupRepository;- private readonly IRepository<CustomerGroupProduct> _customerGroupProductRepository;- private readonly IRepository<CustomerProduct> _customerProductRepository;- private readonly IRepository<CustomerProductPrice> _customerProductPriceRepository;- private readonly IRepository<CustomerTagProduct> _customerTagProductRepository;- private readonly IRepository<CustomerHistoryPassword> _customerHistoryPasswordRepository;- private readonly IRepository<CustomerNote> _customerNoteRepository;- private readonly IRepository<UserApi> _userapiRepository;- private readonly IRepository<SpecificationAttribute> _specificationAttributeRepository;- private readonly IRepository<CheckoutAttribute> _checkoutAttributeRepository;- private readonly IRepository<ProductAttribute> _productAttributeRepository;- private readonly IRepository<AddressAttribute> _addressAttributeRepository;- private readonly IRepository<CustomerAttribute> _customerAttributeRepository;- private readonly IRepository<ContactAttribute> _contactAttributeRepository;- private readonly IRepository<Category> _categoryRepository;- private readonly IRepository<Brand> _brandRepository;- private readonly IRepository<Vendor> _vendorRepository;- private readonly IRepository<Collection> _collectionRepository;- private readonly IRepository<Product> _productRepository;- private readonly IRepository<ProductReservation> _productReservationRepository;- private readonly IRepository<ProductAlsoPurchased> _productalsopurchasedRepository;- private readonly IRepository<EntityUrl> _entityUrlRepository;- private readonly IRepository<EmailAccount> _emailAccountRepository;- private readonly IRepository<MessageTemplate> _messageTemplateRepository;- private readonly IRepository<Country> _countryRepository;- private readonly IRepository<Discount> _discountRepository;- private readonly IRepository<DiscountCoupon> _discountCouponRepository;- private readonly IRepository<DiscountUsageHistory> _discountusageRepository;- private readonly IRepository<BlogPost> _blogPostRepository;- private readonly IRepository<BlogCategory> _blogCategoryRepository;- private readonly IRepository<BlogComment> _blogCommentRepository;- private readonly IRepository<Page> _pageRepository;- private readonly IRepository<NewsItem> _newsItemRepository;- private readonly IRepository<NewsLetterSubscription> _newslettersubscriptionRepository;- private readonly IRepository<ShippingMethod> _shippingMethodRepository;- private readonly IRepository<DeliveryDate> _deliveryDateRepository;- private readonly IRepository<ProductTag> _productTagRepository;- private readonly IRepository<ProductReview> _productReviewRepository;- private readonly IRepository<ProductLayout> _productLayoutRepository;- private readonly IRepository<CategoryLayout> _categoryLayoutRepository;- private readonly IRepository<BrandLayout> _brandLayoutRepository;- private readonly IRepository<CollectionLayout> _collectionLayoutRepository;- private readonly IRepository<PageLayout> _pageLayoutRepository;- private readonly IRepository<ScheduleTask> _scheduleTaskRepository;- private readonly IRepository<LoyaltyPointsHistory> _loyaltypointshistoryRepository;- private readonly IRepository<SearchTerm> _searchtermRepository;- private readonly IRepository<Setting> _settingRepository;- private readonly IRepository<Shipment> _shipmentRepository;- private readonly IRepository<Warehouse> _warehouseRepository;- private readonly IRepository<PickupPoint> _pickupPointsRepository;- private readonly IRepository<Permission> _permissionRepository;- private readonly IRepository<PermissionAction> _permissionAction;- private readonly IRepository<ExternalAuthentication> _externalAuthenticationRepository;- private readonly IRepository<MerchandiseReturnReason> _merchandiseReturnReasonRepository;- private readonly IRepository<MerchandiseReturnAction> _merchandiseReturnActionRepository;- private readonly IRepository<ContactUs> _contactUsRepository;- private readonly IRepository<RecentlyViewedProduct> _recentlyViewedProductRepository;- private readonly IRepository<KnowledgebaseArticle> _knowledgebaseArticleRepository;- private readonly IRepository<KnowledgebaseCategory> _knowledgebaseCategoryRepository;- private readonly IRepository<OrderTag> _orderTagRepository;- private readonly IRepository<OrderStatus> _orderStatusRepository;- private readonly IRepository<PickupPoint> _pickupPointRepository;- private readonly IRepository<OutOfStockSubscription> _outOfStockSubscriptionRepository;- private readonly IRepository<ShipmentNote> _shipmentNoteRepository;- private readonly IRepository<PaymentTransaction> _paymentTransactionRepository;- private readonly IRepository<QueuedEmail> _queuedEmailRepository;- private readonly IRepository<GiftVoucher> _giftVoucherRepository;- private readonly IRepository<DocumentType> _documentTypeRepository;- private readonly IRepository<Document> _documentRepository;- private readonly IRepository<SalesEmployee> _salesRepository;- private readonly IRepository<VendorReview> _vendorReviewRepository;- private readonly IRepository<NewsletterCategory> _newsletterCategoryRepository;- private readonly IRepository<Course> _courseRepository;- private readonly IRepository<CourseLevel> _courseLevelRepository;- private readonly IRepository<RobotsTxt> _robotsTxtRepository;--- private readonly IWebHostEnvironment _hostingEnvironment;- private readonly IServiceProvider _serviceProvider;-- #endregion-- #region Ctor-- public InstallationService(- IServiceProvider serviceProvider,- IWebHostEnvironment webHostEnvironment,- IRepository<GrandNodeVersion> versionRepository,- IRepository<AdminSiteMap> adminRepository,- IRepository<Bid> bidRepository,- IRepository<Affiliate> affiliateRepository,- IRepository<CampaignHistory> campaignHistoryRepository,- IRepository<Campaign> campaignRepository,- IRepository<Order> orderRepository,- IRepository<OrderNote> orderNoteRepository,- IRepository<MerchandiseReturn> merchandiseReturnRepository,- IRepository<MerchandiseReturnNote> merchandiseReturnNoteRepository,- IRepository<Store> storeRepository,- IRepository<MeasureDimension> measureDimensionRepository,- IRepository<MeasureWeight> measureWeightRepository,- IRepository<MeasureUnit> measureUnitRepository,- IRepository<TaxCategory> taxCategoryRepository,- IRepository<Language> languageRepository,- IRepository<TranslationResource> lsrRepository,- IRepository<Currency> currencyRepository,- IRepository<Customer> customerRepository,- IRepository<CustomerGroup> customerGroupRepository,- IRepository<CustomerGroupProduct> customerGroupProductRepository,- IRepository<CustomerProduct> customerProductRepository,- IRepository<CustomerProductPrice> customerProductPriceRepository,- IRepository<CustomerTagProduct> customerTagProductRepository,- IRepository<CustomerHistoryPassword> customerHistoryPasswordRepository,- IRepository<CustomerNote> customerNoteRepository,- IRepository<UserApi> userapiRepository,- IRepository<SpecificationAttribute> specificationAttributeRepository,- IRepository<CheckoutAttribute> checkoutAttributeRepository,- IRepository<ProductAttribute> productAttributeRepository,- IRepository<AddressAttribute> addressAttributeRepository,- IRepository<CustomerAttribute> customerAttributeRepository,- IRepository<ContactAttribute> contactAttributeRepository,- IRepository<Category> categoryRepository,- IRepository<Brand> brandRepository,- IRepository<Vendor> vendorRepository,- IRepository<Collection> collectionRepository,- IRepository<Product> productRepository,- IRepository<ProductReservation> productReservationRepository,- IRepository<ProductAlsoPurchased> productalsopurchasedRepository,- IRepository<EntityUrl> entityUrlRepository,- IRepository<EmailAccount> emailAccountRepository,- IRepository<MessageTemplate> messageTemplateRepository,- IRepository<Country> countryRepository,- IRepository<Discount> discountRepository,- IRepository<DiscountCoupon> discountCouponRepository,- IRepository<DiscountUsageHistory> discountusageRepository,- IRepository<BlogPost> blogPostRepository,- IRepository<BlogCategory> blogCategoryRepository,- IRepository<BlogComment> blogCommentRepository,- IRepository<Page> pageRepository,- IRepository<NewsItem> newsItemRepository,- IRepository<NewsLetterSubscription> newslettersubscriptionRepository,- IRepository<ShippingMethod> shippingMethodRepository,- IRepository<DeliveryDate> deliveryDateRepository,- IRepository<ProductTag> productTagRepository,- IRepository<ProductReview> productReviewRepository,- IRepository<ProductLayout> productLayoutRepository,- IRepository<CategoryLayout> categoryLayoutRepository,- IRepository<BrandLayout> brandLayoutRepository,- IRepository<CollectionLayout> collectionLayoutRepository,- IRepository<PageLayout> pageLayoutRepository,- IRepository<ScheduleTask> scheduleTaskRepository,- IRepository<LoyaltyPointsHistory> loyaltypointshistoryRepository,- IRepository<SearchTerm> searchtermRepository,- IRepository<Setting> settingRepository,- IRepository<Shipment> shipmentRepository,- IRepository<Warehouse> warehouseRepository,- IRepository<PickupPoint> pickupPointsRepository,- IRepository<Permission> permissionRepository,- IRepository<PermissionAction> permissionAction,- IRepository<ExternalAuthentication> externalAuthenticationRepository,- IRepository<MerchandiseReturnReason> merchandiseReturnReasonRepository,- IRepository<MerchandiseReturnAction> merchandiseReturnActionRepository,- IRepository<ContactUs> contactUsRepository,- IRepository<RecentlyViewedProduct> recentlyViewedProductRepository,- IRepository<KnowledgebaseArticle> knowledgebaseArticleRepository,- IRepository<KnowledgebaseCategory> knowledgebaseCategoryRepository,- IRepository<OrderTag> orderTagRepository,- IRepository<OrderStatus> orderStatusRepository,- IRepository<PickupPoint> pickupPointRepository,- IRepository<OutOfStockSubscription> outOfStockSubscriptionRepository,- IRepository<ShipmentNote> shipmentNoteRepository,- IRepository<PaymentTransaction> paymentTransactionRepository,- IRepository<QueuedEmail> queuedEmailRepository,- IRepository<GiftVoucher> giftVoucherRepository,- IRepository<DocumentType> documentTypeRepository,- IRepository<Document> documentRepository,- IRepository<SalesEmployee> salesRepository,- IRepository<VendorReview> vendorReviewRepository,- IRepository<NewsletterCategory> newsletterCategoryRepository,- IRepository<Course> courseRepository,- IRepository<CourseLevel> courseLevelRepository,- IRepository<RobotsTxt> robotsTxtRepository)- {-- _versionRepository = versionRepository;- _adminRepository = adminRepository;- _bidRepository = bidRepository;- _affiliateRepository = affiliateRepository;- _campaignHistoryRepository = campaignHistoryRepository;- _campaignRepository = campaignRepository;- _orderRepository = orderRepository;- _orderNoteRepository = orderNoteRepository;- _storeRepository = storeRepository;- _measureDimensionRepository = measureDimensionRepository;- _measureWeightRepository = measureWeightRepository;- _measureUnitRepository = measureUnitRepository;- _taxCategoryRepository = taxCategoryRepository;- _languageRepository = languageRepository;- _lsrRepository = lsrRepository;- _currencyRepository = currencyRepository;- _customerRepository = customerRepository;- _customerGroupRepository = customerGroupRepository;- _customerProductRepository = customerProductRepository;- _customerProductPriceRepository = customerProductPriceRepository;- _customerGroupProductRepository = customerGroupProductRepository;- _customerTagProductRepository = customerTagProductRepository;- _customerHistoryPasswordRepository = customerHistoryPasswordRepository;- _customerNoteRepository = customerNoteRepository;- _userapiRepository = userapiRepository;- _specificationAttributeRepository = specificationAttributeRepository;- _checkoutAttributeRepository = checkoutAttributeRepository;- _productAttributeRepository = productAttributeRepository;- _addressAttributeRepository = addressAttributeRepository;- _customerAttributeRepository = customerAttributeRepository;- _categoryRepository = categoryRepository;- _brandRepository = brandRepository;- _collectionRepository = collectionRepository;- _productRepository = productRepository;- _productReservationRepository = productReservationRepository;- _productalsopurchasedRepository = productalsopurchasedRepository;- _entityUrlRepository = entityUrlRepository;- _emailAccountRepository = emailAccountRepository;- _messageTemplateRepository = messageTemplateRepository;- _countryRepository = countryRepository;- _discountRepository = discountRepository;- _discountCouponRepository = discountCouponRepository;- _blogPostRepository = blogPostRepository;- _blogCommentRepository = blogCommentRepository;- _pageRepository = pageRepository;- _productReviewRepository = productReviewRepository;- _newsItemRepository = newsItemRepository;- _newslettersubscriptionRepository = newslettersubscriptionRepository;- _shippingMethodRepository = shippingMethodRepository;- _deliveryDateRepository = deliveryDateRepository;- _productTagRepository = productTagRepository;- _productLayoutRepository = productLayoutRepository;- _recentlyViewedProductRepository = recentlyViewedProductRepository;- _categoryLayoutRepository = categoryLayoutRepository;- _brandLayoutRepository = brandLayoutRepository;- _collectionLayoutRepository = collectionLayoutRepository;- _pageLayoutRepository = pageLayoutRepository;- _scheduleTaskRepository = scheduleTaskRepository;- _merchandiseReturnRepository = merchandiseReturnRepository;- _merchandiseReturnNoteRepository = merchandiseReturnNoteRepository;- _loyaltypointshistoryRepository = loyaltypointshistoryRepository;- _searchtermRepository = searchtermRepository;- _settingRepository = settingRepository;- _shipmentRepository = shipmentRepository;- _shipmentNoteRepository = shipmentNoteRepository;- _warehouseRepository = warehouseRepository;- _pickupPointsRepository = pickupPointsRepository;- _permissionRepository = permissionRepository;- _permissionAction = permissionAction;- _vendorRepository = vendorRepository;- _externalAuthenticationRepository = externalAuthenticationRepository;- _discountusageRepository = discountusageRepository;- _merchandiseReturnReasonRepository = merchandiseReturnReasonRepository;- _contactUsRepository = contactUsRepository;- _merchandiseReturnActionRepository = merchandiseReturnActionRepository;- _knowledgebaseArticleRepository = knowledgebaseArticleRepository;- _knowledgebaseCategoryRepository = knowledgebaseCategoryRepository;- _orderTagRepository = orderTagRepository;- _orderStatusRepository = orderStatusRepository;- _pickupPointRepository = pickupPointRepository;- _outOfStockSubscriptionRepository = outOfStockSubscriptionRepository;- _blogCategoryRepository = blogCategoryRepository;- _paymentTransactionRepository = paymentTransactionRepository;- _queuedEmailRepository = queuedEmailRepository;- _giftVoucherRepository = giftVoucherRepository;- _documentTypeRepository = documentTypeRepository;- _documentRepository = documentRepository;- _salesRepository = salesRepository;- _vendorReviewRepository = vendorReviewRepository;- _contactAttributeRepository = contactAttributeRepository;- _newsletterCategoryRepository = newsletterCategoryRepository;- _courseRepository = courseRepository;- _courseLevelRepository = courseLevelRepository;- _robotsTxtRepository = robotsTxtRepository;- _hostingEnvironment = webHostEnvironment;- _serviceProvider = serviceProvider;- }-- #endregion-- #region Utilities-- protected virtual string GetSamplesPath()- {- return Path.Combine(_hostingEnvironment.WebRootPath, "assets/samples/");- }-+ _versionRepository = versionRepository;+ _adminRepository = adminRepository;+ _bidRepository = bidRepository;+ _affiliateRepository = affiliateRepository;+ _campaignHistoryRepository = campaignHistoryRepository;+ _campaignRepository = campaignRepository;+ _orderRepository = orderRepository;+ _orderNoteRepository = orderNoteRepository;+ _storeRepository = storeRepository;+ _measureDimensionRepository = measureDimensionRepository;+ _measureWeightRepository = measureWeightRepository;+ _measureUnitRepository = measureUnitRepository;+ _taxCategoryRepository = taxCategoryRepository;+ _languageRepository = languageRepository;+ _lsrRepository = lsrRepository;+ _currencyRepository = currencyRepository;+ _customerRepository = customerRepository;+ _customerGroupRepository = customerGroupRepository;+ _customerProductRepository = customerProductRepository;+ _customerProductPriceRepository = customerProductPriceRepository;+ _customerGroupProductRepository = customerGroupProductRepository;+ _customerTagProductRepository = customerTagProductRepository;+ _customerHistoryPasswordRepository = customerHistoryPasswordRepository;+ _customerNoteRepository = customerNoteRepository;+ _userapiRepository = userapiRepository;+ _specificationAttributeRepository = specificationAttributeRepository;+ _checkoutAttributeRepository = checkoutAttributeRepository;+ _productAttributeRepository = productAttributeRepository;+ _addressAttributeRepository = addressAttributeRepository;+ _customerAttributeRepository = customerAttributeRepository;+ _categoryRepository = categoryRepository;+ _brandRepository = brandRepository;+ _collectionRepository = collectionRepository;+ _productRepository = productRepository;+ _productReservationRepository = productReservationRepository;+ _productalsopurchasedRepository = productalsopurchasedRepository;+ _entityUrlRepository = entityUrlRepository;+ _emailAccountRepository = emailAccountRepository;+ _messageTemplateRepository = messageTemplateRepository;+ _countryRepository = countryRepository;+ _discountRepository = discountRepository;+ _discountCouponRepository = discountCouponRepository;+ _blogPostRepository = blogPostRepository;+ _blogCommentRepository = blogCommentRepository;+ _pageRepository = pageRepository;+ _productReviewRepository = productReviewRepository;+ _newsItemRepository = newsItemRepository;+ _newslettersubscriptionRepository = newslettersubscriptionRepository;+ _shippingMethodRepository = shippingMethodRepository;+ _deliveryDateRepository = deliveryDateRepository;+ _productTagRepository = productTagRepository;+ _productLayoutRepository = productLayoutRepository;+ _recentlyViewedProductRepository = recentlyViewedProductRepository;+ _categoryLayoutRepository = categoryLayoutRepository;+ _brandLayoutRepository = brandLayoutRepository;+ _collectionLayoutRepository = collectionLayoutRepository;+ _pageLayoutRepository = pageLayoutRepository;+ _scheduleTaskRepository = scheduleTaskRepository;+ _merchandiseReturnRepository = merchandiseReturnRepository;+ _merchandiseReturnNoteRepository = merchandiseReturnNoteRepository;+ _loyaltypointshistoryRepository = loyaltypointshistoryRepository;+ _searchtermRepository = searchtermRepository;+ _settingRepository = settingRepository;+ _shipmentRepository = shipmentRepository;+ _shipmentNoteRepository = shipmentNoteRepository;+ _warehouseRepository = warehouseRepository;+ _pickupPointsRepository = pickupPointsRepository;+ _permissionRepository = permissionRepository;+ _permissionAction = permissionAction;+ _vendorRepository = vendorRepository;+ _externalAuthenticationRepository = externalAuthenticationRepository;+ _discountusageRepository = discountusageRepository;+ _merchandiseReturnReasonRepository = merchandiseReturnReasonRepository;+ _contactUsRepository = contactUsRepository;+ _merchandiseReturnActionRepository = merchandiseReturnActionRepository;+ _knowledgebaseArticleRepository = knowledgebaseArticleRepository;+ _knowledgebaseCategoryRepository = knowledgebaseCategoryRepository;+ _orderTagRepository = orderTagRepository;+ _orderStatusRepository = orderStatusRepository;+ _pickupPointRepository = pickupPointRepository;+ _outOfStockSubscriptionRepository = outOfStockSubscriptionRepository;+ _blogCategoryRepository = blogCategoryRepository;+ _paymentTransactionRepository = paymentTransactionRepository;+ _queuedEmailRepository = queuedEmailRepository;+ _giftVoucherRepository = giftVoucherRepository;+ _documentTypeRepository = documentTypeRepository;+ _documentRepository = documentRepository;+ _salesRepository = salesRepository;+ _vendorReviewRepository = vendorReviewRepository;+ _contactAttributeRepository = contactAttributeRepository;+ _newsletterCategoryRepository = newsletterCategoryRepository;+ _courseRepository = courseRepository;+ _courseLevelRepository = courseLevelRepository;+ _robotsTxtRepository = robotsTxtRepository;+ _hostingEnvironment = webHostEnvironment;+ _serviceProvider = serviceProvider;+ }- protected virtual async Task InstallVersion()- {- var version = new GrandNodeVersion {- DataBaseVersion = GrandVersion.SupportedDBVersion- };- await _versionRepository.InsertAsync(version);- }+ #endregion- protected virtual Task InstallMenuAdminSiteMap()- {- StandardAdminSiteMap.SiteMap.ForEach(x=>_adminRepository.Insert(x));- return Task.CompletedTask;- }+ #region Methods- protected virtual async Task HashDefaultCustomerPassword(string defaultUserEmail, string defaultUserPassword)+ public virtual async Task InstallData(string httpscheme, HostString host, string defaultUserEmail,+ string defaultUserPassword, string collation, bool installSampleData = true, string companyName = "",+ string companyAddress = "",+ string companyPhoneNumber = "", string companyEmail = "")+ {+ defaultUserEmail = defaultUserEmail.ToLower();++ await CreateTables(collation);+ await InstallVersion();+ await InstallMenuAdminSiteMap();+ await InstallStores(httpscheme, host, companyName, companyAddress, companyPhoneNumber, companyEmail);+ await InstallMeasures();+ await InstallTaxCategories();+ await InstallLanguages();+ await InstallCurrencies();+ await InstallCountriesAndStates();+ await InstallShippingMethods();+ await InstallDeliveryDates();+ await InstallCustomersAndUsers(defaultUserEmail, defaultUserPassword);+ await InstallEmailAccounts();+ await InstallMessageTemplates();+ await InstallSettings(installSampleData);+ await InstallPageLayouts();+ await InstallPages();+ await InstallLocaleResources();+ await HashDefaultCustomerPassword(defaultUserEmail, defaultUserPassword);+ await InstallProductLayouts();+ await InstallCategoryLayouts();+ await InstallBrandLayouts();+ await InstallCollectionLayouts();+ await InstallScheduleTasks();+ await InstallMerchandiseReturnReasons();+ await InstallMerchandiseReturnActions();+ await InstallOrderStatus();+ if (installSampleData){- var customerManagerService = _serviceProvider.GetRequiredService<ICustomerManagerService>();- await customerManagerService.ChangePassword(new ChangePasswordRequest(defaultUserEmail, PasswordFormat.Hashed, defaultUserPassword));+ await InstallCheckoutAttributes();+ await InstallSpecificationAttributes();+ await InstallProductAttributes();+ await InstallCategories();+ await InstallBrands();+ await InstallProducts(defaultUserEmail);+ await InstallDiscounts();+ await InstallBlogPosts();+ await InstallNews();+ await InstallWarehouses();+ await InstallPickupPoints();+ await InstallVendors();+ await InstallAffiliates();+ await InstallOrderTags();}+ }- private async Task CreateIndexes(IDatabaseContext dbContext, DataSettings dataSettings)- {- //version- await dbContext.CreateIndex(_versionRepository, OrderBuilder<GrandNodeVersion>.Create().Ascending(x => x.DataBaseVersion), "DataBaseVersion", true);-- //Store- await dbContext.CreateIndex(_storeRepository, OrderBuilder<Store>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //Language- await dbContext.CreateIndex(_lsrRepository, OrderBuilder<TranslationResource>.Create().Ascending(x => x.LanguageId).Ascending(x => x.Name), "Language");- await dbContext.CreateIndex(_lsrRepository, OrderBuilder<TranslationResource>.Create().Ascending(x => x.Name), "ResourceName");- await dbContext.CreateIndex(_languageRepository, OrderBuilder<Language>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //Currency- await dbContext.CreateIndex(_currencyRepository, OrderBuilder<Currency>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //customer- await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Descending(x => x.CreatedOnUtc).Ascending(x => x.Deleted), "CreatedOnUtc_1");- await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Ascending(x => x.LastActivityDateUtc), "LastActivityDateUtc_1");- await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Ascending(x => x.CustomerGuid), "CustomerGuid_1");- await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Ascending(x => x.Email), "Email_1");- await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- await dbContext.CreateIndex(_customerGroupRepository, OrderBuilder<CustomerGroup>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_customerGroupRepository, OrderBuilder<CustomerGroup>.Create().Ascending(x => x.Name), "Name");- await dbContext.CreateIndex(_customerGroupRepository, OrderBuilder<CustomerGroup>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");-- await dbContext.CreateIndex(_vendorRepository, OrderBuilder<Vendor>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");- await dbContext.CreateIndex(_vendorReviewRepository, OrderBuilder<VendorReview>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");--- await dbContext.CreateIndex(_addressAttributeRepository, OrderBuilder<AddressAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_customerAttributeRepository, OrderBuilder<CustomerAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- await dbContext.CreateIndex(_customerHistoryPasswordRepository, OrderBuilder<CustomerHistoryPassword>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //product customer group- await dbContext.CreateIndex(_customerGroupProductRepository, OrderBuilder<CustomerGroupProduct>.Create().Ascending(x => x.CustomerGroupId).Ascending(x => x.DisplayOrder), "CustomerGroupId_DisplayOrder");- await dbContext.CreateIndex(_customerGroupProductRepository, OrderBuilder<CustomerGroupProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //customer personalize product- await dbContext.CreateIndex(_customerProductRepository, OrderBuilder<CustomerProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.DisplayOrder), "CustomerProduct");- await dbContext.CreateIndex(_customerProductRepository, OrderBuilder<CustomerProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId), "CustomerProduct_Unique", true);- await dbContext.CreateIndex(_customerProductRepository, OrderBuilder<CustomerProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //customer product price- await dbContext.CreateIndex(_customerProductPriceRepository, OrderBuilder<CustomerProductPrice>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId), "CustomerProduct", true);-- //customer tag history- await dbContext.CreateIndex(_customerTagProductRepository, OrderBuilder<CustomerTagProduct>.Create().Ascending(x => x.Id).Ascending(x => x.DisplayOrder), "CustomerTagId_DisplayOrder");- await dbContext.CreateIndex(_customerTagProductRepository, OrderBuilder<CustomerTagProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //customer history password- await dbContext.CreateIndex(_customerHistoryPasswordRepository, OrderBuilder<CustomerHistoryPassword>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc), "CustomerId");-- //customer note- await dbContext.CreateIndex(_customerNoteRepository, OrderBuilder<CustomerNote>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc), "CustomerId");- await dbContext.CreateIndex(_customerNoteRepository, OrderBuilder<CustomerNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //user api- await dbContext.CreateIndex(_userapiRepository, OrderBuilder<UserApi>.Create().Ascending(x => x.Email), "Email", true);-- //specificationAttribute- await dbContext.CreateIndex(_specificationAttributeRepository, OrderBuilder<SpecificationAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //checkoutAttribute- await dbContext.CreateIndex(_checkoutAttributeRepository, OrderBuilder<CheckoutAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //contact attr- await dbContext.CreateIndex(_contactAttributeRepository, OrderBuilder<ContactAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //category- await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.Published).Ascending(x => x.ShowOnHomePage).Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");- await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.ParentCategoryId).Ascending(x => x.Published).Ascending(x => x.DisplayOrder), "ParentCategoryId_1_DisplayOrder_1");- await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.FeaturedProductsOnHomePage).Ascending(x => x.Published).Ascending(x => x.DisplayOrder), "FeaturedProductsOnHomePage_DisplayOrder_1");- await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.SearchBoxDisplayOrder), "SearchBoxDisplayOrder");- await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.ParentCategoryId).Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "ParentCategoryId_1_DisplayOrder_1_Name_1");-- await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder_1");-- //collection- await dbContext.CreateIndex(_collectionRepository, OrderBuilder<Collection>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");- await dbContext.CreateIndex(_collectionRepository, OrderBuilder<Collection>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_collectionRepository, OrderBuilder<Collection>.Create().Ascending(x => x.ShowOnHomePage).Ascending(x => x.Published).Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");- await dbContext.CreateIndex(_collectionRepository, OrderBuilder<Collection>.Create().Ascending(x => x.AppliedDiscounts), "AppliedDiscounts");-- //brands- await dbContext.CreateIndex(_brandRepository, OrderBuilder<Brand>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");- await dbContext.CreateIndex(_brandRepository, OrderBuilder<Brand>.Create().Ascending(x => x.ShowOnHomePage).Ascending(x => x.Published).Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");- await dbContext.CreateIndex(_brandRepository, OrderBuilder<Brand>.Create().Ascending(x => x.AppliedDiscounts), "AppliedDiscounts");-- //Product- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.MarkAsNew).Ascending(x => x.CreatedOnUtc), "MarkAsNew_1_CreatedOnUtc_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.ShowOnHomePage).Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "ShowOnHomePage_1_Published_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.BestSeller).Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "ShowOnBestSeller_1_Published_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.ParentGroupedProductId).Ascending(x => x.DisplayOrder), "ParentGroupedProductId_1_DisplayOrder_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.ProductTags).Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.Name), "ProductTags._id_1_Name_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Name), "Name_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending("ProductCategories.DisplayOrder"), "CategoryId_1_DisplayOrder_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.DisplayOrderCategory).Ascending("ProductCategories.CategoryId"), "ProductCategories.CategoryId_1_OrderCategory_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.Name).Ascending("ProductCategories.CategoryId"), "ProductCategories.CategoryId_1_Name_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.Price).Ascending("ProductCategories.CategoryId"), "ProductCategories.CategoryId_1_Price_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.Sold).Ascending("ProductCategories.CategoryId"), "ProductCategories.CategoryId_1_Sold_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending("ProductCategories.CategoryId").Ascending("ProductCategories.IsFeaturedProduct"), "ProductCategories.CategoryId_1_IsFeaturedProduct_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.DisplayOrderCollection), "ProductCollections.CollectionId_1_OrderCategory_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.Name), "ProductCollections.CollectionId_1_Name_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.Sold), "ProductCollections.CollectionId_1_Sold_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending("ProductCollections.IsFeaturedProduct").Ascending(x => x.Published).Ascending(x => x.VisibleIndividually), "ProductCollections.CollectionId_1_IsFeaturedProduct_1");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending(x => x.BrandId).Ascending(x => x.DisplayOrderBrand), "ProductBrand");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually).Ascending("ProductSpecificationAttributes.SpecificationAttributeOptionId").Ascending("ProductSpecificationAttributes.AllowFiltering"), "ProductSpecificationAttributes");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");-- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderCategory), "DisplayOrderCategory");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderBrand), "DisplayOrderBrand");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderCollection), "DisplayOrderCollection");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Price), "Price");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.OnSale), "OnSale");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Viewed), "Viewed");- await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Sold), "Sold");-- //product attribute- await dbContext.CreateIndex(_productAttributeRepository, OrderBuilder<ProductAttribute>.Create().Ascending(x => x.Name), "Name");-- //Product layout- await dbContext.CreateIndex(_productLayoutRepository, OrderBuilder<ProductLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_categoryLayoutRepository, OrderBuilder<CategoryLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_brandLayoutRepository, OrderBuilder<BrandLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_collectionLayoutRepository, OrderBuilder<CollectionLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_pageLayoutRepository, OrderBuilder<PageLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //Delivery date- await dbContext.CreateIndex(_deliveryDateRepository, OrderBuilder<DeliveryDate>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //Tax- await dbContext.CreateIndex(_taxCategoryRepository, OrderBuilder<TaxCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //Measure- await dbContext.CreateIndex(_measureWeightRepository, OrderBuilder<MeasureWeight>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_measureUnitRepository, OrderBuilder<MeasureUnit>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_measureDimensionRepository, OrderBuilder<MeasureDimension>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //productreseration- await dbContext.CreateIndex(_productReservationRepository, OrderBuilder<ProductReservation>.Create().Ascending(x => x.ProductId).Ascending(x => x.Date), "ProductReservation");- await dbContext.CreateIndex(_productReservationRepository, OrderBuilder<ProductReservation>.Create().Ascending(x => x.Date), "Date");-- //bid- await dbContext.CreateIndex(_bidRepository, OrderBuilder<Bid>.Create().Ascending(x => x.ProductId).Ascending(x => x.CustomerId).Descending(x => x.Date), "ProductCustomer");- await dbContext.CreateIndex(_bidRepository, OrderBuilder<Bid>.Create().Ascending(x => x.ProductId).Descending(x => x.Date), "ProductDate");- await dbContext.CreateIndex(_bidRepository, OrderBuilder<Bid>.Create().Descending(x => x.Date), "Date");-- //ProductReview- await dbContext.CreateIndex(_productReviewRepository, OrderBuilder<ProductReview>.Create().Ascending(x => x.ProductId).Ascending(x => x.CreatedOnUtc), "ProductId");- await dbContext.CreateIndex(_productReviewRepository, OrderBuilder<ProductReview>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //Recently Viewed Products- await dbContext.CreateIndex(_recentlyViewedProductRepository, OrderBuilder<RecentlyViewedProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId).Descending(x => x.CreatedOnUtc), "CustomerId.ProductId");- await dbContext.CreateIndex(_recentlyViewedProductRepository, OrderBuilder<RecentlyViewedProduct>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //Product also purchased- await dbContext.CreateIndex(_productalsopurchasedRepository, OrderBuilder<ProductAlsoPurchased>.Create().Ascending(x => x.ProductId), "ProductId");-- //url record- await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.Slug), "Slug");- await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.Slug).Ascending(x => x.IsActive), "SlugActive");- await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.EntityId).Ascending(x => x.EntityName).Ascending(x => x.LanguageId).Ascending(x => x.IsActive), "UrlEntity");- await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.IsActive), "IsActive");-- //message template- await dbContext.CreateIndex(_messageTemplateRepository, OrderBuilder<MessageTemplate>.Create().Ascending(x => x.Name), "Name");-- // Country and Stateprovince- await dbContext.CreateIndex(_countryRepository, OrderBuilder<Country>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //discount- await dbContext.CreateIndex(_discountRepository, OrderBuilder<Discount>.Create().Ascending(x => x.Name), "Name)");-- await dbContext.CreateIndex(_discountCouponRepository, OrderBuilder<DiscountCoupon>.Create().Ascending(x => x.CouponCode), "CouponCode", true);- await dbContext.CreateIndex(_discountCouponRepository, OrderBuilder<DiscountCoupon>.Create().Ascending(x => x.DiscountId), "DiscountId");-- await dbContext.CreateIndex(_discountusageRepository, OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.CustomerId), "CustomerId");- await dbContext.CreateIndex(_discountusageRepository, OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.DiscountId), "DiscountId");- await dbContext.CreateIndex(_discountusageRepository, OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.OrderId), "OrderId");-- await dbContext.CreateIndex(_discountusageRepository, OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //blog- await dbContext.CreateIndex(_blogPostRepository, OrderBuilder<BlogPost>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");- await dbContext.CreateIndex(_blogCategoryRepository, OrderBuilder<BlogCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_blogCommentRepository, OrderBuilder<BlogComment>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //knowledgebase- await dbContext.CreateIndex(_knowledgebaseArticleRepository, OrderBuilder<KnowledgebaseArticle>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_knowledgebaseCategoryRepository, OrderBuilder<KnowledgebaseCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_knowledgebaseCategoryRepository, OrderBuilder<KnowledgebaseCategory>.Create().Ascending(x => x.ParentCategoryId).Ascending(x => x.DisplayOrder), "ParentCategoryId_DisplayOrder");-- //page- await dbContext.CreateIndex(_pageRepository, OrderBuilder<Page>.Create().Ascending(x => x.SystemName), "SystemName");-- //news- await dbContext.CreateIndex(_newsItemRepository, OrderBuilder<NewsItem>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //newsletter- await dbContext.CreateIndex(_newslettersubscriptionRepository, OrderBuilder<NewsLetterSubscription>.Create().Ascending(x => x.CustomerId), "CustomerId");- await dbContext.CreateIndex(_newslettersubscriptionRepository, OrderBuilder<NewsLetterSubscription>.Create().Ascending(x => x.Email), "Email");-- //Campaign- await dbContext.CreateIndex(_campaignRepository, OrderBuilder<Campaign>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");- await dbContext.CreateIndex(_campaignHistoryRepository, OrderBuilder<CampaignHistory>.Create().Ascending(x => x.CampaignId).Descending(x => x.CreatedDateUtc), "CampaignId");-- //loyalty points- await dbContext.CreateIndex(_loyaltypointshistoryRepository, OrderBuilder<LoyaltyPointsHistory>.Create().Ascending(x => x.CustomerId), "CustomerId");- await dbContext.CreateIndex(_loyaltypointshistoryRepository, OrderBuilder<LoyaltyPointsHistory>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //giftvoucher- await dbContext.CreateIndex(_giftVoucherRepository, OrderBuilder<GiftVoucher>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //search term- await dbContext.CreateIndex(_searchtermRepository, OrderBuilder<SearchTerm>.Create().Descending(x => x.Count), "Count");-- //setting- await dbContext.CreateIndex(_settingRepository, OrderBuilder<Setting>.Create().Ascending(x => x.Name), "Name");-- //shipment- await dbContext.CreateIndex(_shipmentRepository, OrderBuilder<Shipment>.Create().Ascending(x => x.ShipmentNumber), "ShipmentNumber", true);- await dbContext.CreateIndex(_shipmentRepository, OrderBuilder<Shipment>.Create().Ascending(x => x.OrderId), "OrderId");- await dbContext.CreateIndex(_shipmentRepository, OrderBuilder<Shipment>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- await dbContext.CreateIndex(_shipmentNoteRepository, OrderBuilder<ShipmentNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //order- await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc), "CustomerId_1_CreatedOnUtc_-1");- await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc_-1");- await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Descending(x => x.OrderNumber), "OrderNumber");- await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending(x => x.Code), "OrderCode");- await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending("OrderItems.ProductId"), "OrderItemProductId");- await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending("OrderItems.Id"), "OrderItems._id");-- await dbContext.CreateIndex(_orderStatusRepository, OrderBuilder<OrderStatus>.Create().Ascending(x => x.StatusId), "StatusId", true);-- await dbContext.CreateIndex(_orderNoteRepository, OrderBuilder<OrderNote>.Create().Ascending(x => x.OrderId).Descending(x => x.CreatedOnUtc), "OrderId_Created");- await dbContext.CreateIndex(_orderNoteRepository, OrderBuilder<OrderNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //payments- await dbContext.CreateIndex(_paymentTransactionRepository, OrderBuilder<PaymentTransaction>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //queuemail- await dbContext.CreateIndex(_queuedEmailRepository, OrderBuilder<QueuedEmail>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");- await dbContext.CreateIndex(_queuedEmailRepository, OrderBuilder<QueuedEmail>.Create().Descending(x => x.PriorityId).Ascending(x => x.CreatedOnUtc), "PriorityId_CreatedOnUtc");-- //permision- await dbContext.CreateIndex(_permissionRepository, OrderBuilder<Permission>.Create().Ascending(x => x.SystemName), "SystemName", true);- await dbContext.CreateIndex(_permissionRepository, OrderBuilder<Permission>.Create().Ascending(x => x.Name), "Name", false);-- await dbContext.CreateIndex(_permissionAction, OrderBuilder<PermissionAction>.Create().Ascending(x => x.SystemName), "SystemName");-- //externalauth- await dbContext.CreateIndex(_externalAuthenticationRepository, OrderBuilder<ExternalAuthentication>.Create().Ascending(x => x.CustomerId), "CustomerId");-- //merchandise return- await dbContext.CreateIndex(_merchandiseReturnRepository, OrderBuilder<MerchandiseReturn>.Create().Ascending(x => x.ReturnNumber), "ReturnNumber", true);- await dbContext.CreateIndex(_merchandiseReturnRepository, OrderBuilder<MerchandiseReturn>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc", false);- await dbContext.CreateIndex(_merchandiseReturnActionRepository, OrderBuilder<MerchandiseReturnAction>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_merchandiseReturnReasonRepository, OrderBuilder<MerchandiseReturnReason>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- await dbContext.CreateIndex(_merchandiseReturnNoteRepository, OrderBuilder<MerchandiseReturnNote>.Create().Ascending(x => x.MerchandiseReturnId).Descending(x => x.CreatedOnUtc), "MerchandiseReturnId_CreatedOn");- await dbContext.CreateIndex(_merchandiseReturnNoteRepository, OrderBuilder<MerchandiseReturnNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //contactus- await dbContext.CreateIndex(_contactUsRepository, OrderBuilder<ContactUs>.Create().Ascending(x => x.Email), "Email");- await dbContext.CreateIndex(_contactUsRepository, OrderBuilder<ContactUs>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //page- await dbContext.CreateIndex(_pageRepository, OrderBuilder<Page>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.SystemName), "DisplayOrder_SystemName");-- //warehouse- await dbContext.CreateIndex(_warehouseRepository, OrderBuilder<Warehouse>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //shipping method- await dbContext.CreateIndex(_shippingMethodRepository, OrderBuilder<ShippingMethod>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //order status- await dbContext.CreateIndex(_orderStatusRepository, OrderBuilder<OrderStatus>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //country- await dbContext.CreateIndex(_countryRepository, OrderBuilder<Country>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");-- //picpup points- await dbContext.CreateIndex(_pickupPointRepository, OrderBuilder<PickupPoint>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //outofstock- await dbContext.CreateIndex(_outOfStockSubscriptionRepository, OrderBuilder<OutOfStockSubscription>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");-- //document- await dbContext.CreateIndex(_documentTypeRepository, OrderBuilder<DocumentType>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- await dbContext.CreateIndex(_documentTypeRepository, OrderBuilder<DocumentType>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");-- //sales- await dbContext.CreateIndex(_salesRepository, OrderBuilder<SalesEmployee>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ #endregion++ #region Fields++ private readonly IRepository<GrandNodeVersion> _versionRepository;+ private readonly IRepository<AdminSiteMap> _adminRepository;+ private readonly IRepository<Bid> _bidRepository;+ private readonly IRepository<Affiliate> _affiliateRepository;+ private readonly IRepository<CampaignHistory> _campaignHistoryRepository;+ private readonly IRepository<Campaign> _campaignRepository;+ private readonly IRepository<Order> _orderRepository;+ private readonly IRepository<OrderNote> _orderNoteRepository;+ private readonly IRepository<MerchandiseReturn> _merchandiseReturnRepository;+ private readonly IRepository<MerchandiseReturnNote> _merchandiseReturnNoteRepository;+ private readonly IRepository<Store> _storeRepository;+ private readonly IRepository<MeasureDimension> _measureDimensionRepository;+ private readonly IRepository<MeasureWeight> _measureWeightRepository;+ private readonly IRepository<MeasureUnit> _measureUnitRepository;+ private readonly IRepository<TaxCategory> _taxCategoryRepository;+ private readonly IRepository<Language> _languageRepository;+ private readonly IRepository<TranslationResource> _lsrRepository;+ private readonly IRepository<Currency> _currencyRepository;+ private readonly IRepository<Customer> _customerRepository;+ private readonly IRepository<CustomerGroup> _customerGroupRepository;+ private readonly IRepository<CustomerGroupProduct> _customerGroupProductRepository;+ private readonly IRepository<CustomerProduct> _customerProductRepository;+ private readonly IRepository<CustomerProductPrice> _customerProductPriceRepository;+ private readonly IRepository<CustomerTagProduct> _customerTagProductRepository;+ private readonly IRepository<CustomerHistoryPassword> _customerHistoryPasswordRepository;+ private readonly IRepository<CustomerNote> _customerNoteRepository;+ private readonly IRepository<UserApi> _userapiRepository;+ private readonly IRepository<SpecificationAttribute> _specificationAttributeRepository;+ private readonly IRepository<CheckoutAttribute> _checkoutAttributeRepository;+ private readonly IRepository<ProductAttribute> _productAttributeRepository;+ private readonly IRepository<AddressAttribute> _addressAttributeRepository;+ private readonly IRepository<CustomerAttribute> _customerAttributeRepository;+ private readonly IRepository<ContactAttribute> _contactAttributeRepository;+ private readonly IRepository<Category> _categoryRepository;+ private readonly IRepository<Brand> _brandRepository;+ private readonly IRepository<Vendor> _vendorRepository;+ private readonly IRepository<Collection> _collectionRepository;+ private readonly IRepository<Product> _productRepository;+ private readonly IRepository<ProductReservation> _productReservationRepository;+ private readonly IRepository<ProductAlsoPurchased> _productalsopurchasedRepository;+ private readonly IRepository<EntityUrl> _entityUrlRepository;+ private readonly IRepository<EmailAccount> _emailAccountRepository;+ private readonly IRepository<MessageTemplate> _messageTemplateRepository;+ private readonly IRepository<Country> _countryRepository;+ private readonly IRepository<Discount> _discountRepository;+ private readonly IRepository<DiscountCoupon> _discountCouponRepository;+ private readonly IRepository<DiscountUsageHistory> _discountusageRepository;+ private readonly IRepository<BlogPost> _blogPostRepository;+ private readonly IRepository<BlogCategory> _blogCategoryRepository;+ private readonly IRepository<BlogComment> _blogCommentRepository;+ private readonly IRepository<Page> _pageRepository;+ private readonly IRepository<NewsItem> _newsItemRepository;+ private readonly IRepository<NewsLetterSubscription> _newslettersubscriptionRepository;+ private readonly IRepository<ShippingMethod> _shippingMethodRepository;+ private readonly IRepository<DeliveryDate> _deliveryDateRepository;+ private readonly IRepository<ProductTag> _productTagRepository;+ private readonly IRepository<ProductReview> _productReviewRepository;+ private readonly IRepository<ProductLayout> _productLayoutRepository;+ private readonly IRepository<CategoryLayout> _categoryLayoutRepository;+ private readonly IRepository<BrandLayout> _brandLayoutRepository;+ private readonly IRepository<CollectionLayout> _collectionLayoutRepository;+ private readonly IRepository<PageLayout> _pageLayoutRepository;+ private readonly IRepository<ScheduleTask> _scheduleTaskRepository;+ private readonly IRepository<LoyaltyPointsHistory> _loyaltypointshistoryRepository;+ private readonly IRepository<SearchTerm> _searchtermRepository;+ private readonly IRepository<Setting> _settingRepository;+ private readonly IRepository<Shipment> _shipmentRepository;+ private readonly IRepository<Warehouse> _warehouseRepository;+ private readonly IRepository<PickupPoint> _pickupPointsRepository;+ private readonly IRepository<Permission> _permissionRepository;+ private readonly IRepository<PermissionAction> _permissionAction;+ private readonly IRepository<ExternalAuthentication> _externalAuthenticationRepository;+ private readonly IRepository<MerchandiseReturnReason> _merchandiseReturnReasonRepository;+ private readonly IRepository<MerchandiseReturnAction> _merchandiseReturnActionRepository;+ private readonly IRepository<ContactUs> _contactUsRepository;+ private readonly IRepository<RecentlyViewedProduct> _recentlyViewedProductRepository;+ private readonly IRepository<KnowledgebaseArticle> _knowledgebaseArticleRepository;+ private readonly IRepository<KnowledgebaseCategory> _knowledgebaseCategoryRepository;+ private readonly IRepository<OrderTag> _orderTagRepository;+ private readonly IRepository<OrderStatus> _orderStatusRepository;+ private readonly IRepository<PickupPoint> _pickupPointRepository;+ private readonly IRepository<OutOfStockSubscription> _outOfStockSubscriptionRepository;+ private readonly IRepository<ShipmentNote> _shipmentNoteRepository;+ private readonly IRepository<PaymentTransaction> _paymentTransactionRepository;+ private readonly IRepository<QueuedEmail> _queuedEmailRepository;+ private readonly IRepository<GiftVoucher> _giftVoucherRepository;+ private readonly IRepository<DocumentType> _documentTypeRepository;+ private readonly IRepository<Document> _documentRepository;+ private readonly IRepository<SalesEmployee> _salesRepository;+ private readonly IRepository<VendorReview> _vendorReviewRepository;+ private readonly IRepository<NewsletterCategory> _newsletterCategoryRepository;+ private readonly IRepository<Course> _courseRepository;+ private readonly IRepository<CourseLevel> _courseLevelRepository;+ private readonly IRepository<RobotsTxt> _robotsTxtRepository;+++ private readonly IWebHostEnvironment _hostingEnvironment;+ private readonly IServiceProvider _serviceProvider;++ #endregion++ #region Utilities++ protected virtual string GetSamplesPath()+ {+ return Path.Combine(_hostingEnvironment.WebRootPath, "assets/samples/");+ }- //newslettercategory- await dbContext.CreateIndex(_newsletterCategoryRepository, OrderBuilder<NewsletterCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");- //course- await dbContext.CreateIndex(_courseRepository, OrderBuilder<Course>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");- await dbContext.CreateIndex(_courseLevelRepository, OrderBuilder<CourseLevel>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ protected virtual async Task InstallVersion()+ {+ var version = new GrandNodeVersion {+ DataBaseVersion = GrandVersion.SupportedDBVersion+ };+ await _versionRepository.InsertAsync(version);+ }- //admin site map- await dbContext.CreateIndex(_adminRepository, OrderBuilder<AdminSiteMap>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ protected virtual Task InstallMenuAdminSiteMap()+ {+ StandardAdminSiteMap.SiteMap.ForEach(x => _adminRepository.Insert(x));+ return Task.CompletedTask;+ }- //if(dataSettings.DbProvider == DbProvider.CosmosDB)- //{- // //- // //db.fs.chunks.createIndex({'n': 1})- // //To Fix problem with download files from GridFSBucket- // //- //}+ protected virtual async Task HashDefaultCustomerPassword(string defaultUserEmail, string defaultUserPassword)+ {+ var customerManagerService = _serviceProvider.GetRequiredService<ICustomerManagerService>();+ await customerManagerService.ChangePassword(new ChangePasswordRequest(defaultUserEmail, PasswordFormat.Hashed,+ defaultUserPassword));+ }- }+ private async Task CreateIndexes(IDatabaseContext dbContext, DataSettings dataSettings)+ {+ //version+ await dbContext.CreateIndex(_versionRepository,+ OrderBuilder<GrandNodeVersion>.Create().Ascending(x => x.DataBaseVersion), "DataBaseVersion", true);++ //Store+ await dbContext.CreateIndex(_storeRepository, OrderBuilder<Store>.Create().Ascending(x => x.DisplayOrder),+ "DisplayOrder");++ //Language+ await dbContext.CreateIndex(_lsrRepository,+ OrderBuilder<TranslationResource>.Create().Ascending(x => x.LanguageId).Ascending(x => x.Name), "Language");+ await dbContext.CreateIndex(_lsrRepository, OrderBuilder<TranslationResource>.Create().Ascending(x => x.Name),+ "ResourceName");+ await dbContext.CreateIndex(_languageRepository, OrderBuilder<Language>.Create().Ascending(x => x.DisplayOrder),+ "DisplayOrder");++ //Currency+ await dbContext.CreateIndex(_currencyRepository, OrderBuilder<Currency>.Create().Ascending(x => x.DisplayOrder),+ "DisplayOrder");++ //customer+ await dbContext.CreateIndex(_customerRepository,+ OrderBuilder<Customer>.Create().Descending(x => x.CreatedOnUtc).Ascending(x => x.Deleted),+ "CreatedOnUtc_1");+ await dbContext.CreateIndex(_customerRepository,+ OrderBuilder<Customer>.Create().Ascending(x => x.LastActivityDateUtc), "LastActivityDateUtc_1");+ await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Ascending(x => x.CustomerGuid),+ "CustomerGuid_1");+ await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Ascending(x => x.Email),+ "Email_1");+ await dbContext.CreateIndex(_customerRepository,+ OrderBuilder<Customer>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ await dbContext.CreateIndex(_customerGroupRepository,+ OrderBuilder<CustomerGroup>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_customerGroupRepository,+ OrderBuilder<CustomerGroup>.Create().Ascending(x => x.Name), "Name");+ await dbContext.CreateIndex(_customerGroupRepository,+ OrderBuilder<CustomerGroup>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name),+ "DisplayOrder_Name");++ await dbContext.CreateIndex(_vendorRepository,+ OrderBuilder<Vendor>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");+ await dbContext.CreateIndex(_vendorReviewRepository,+ OrderBuilder<VendorReview>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");+++ await dbContext.CreateIndex(_addressAttributeRepository,+ OrderBuilder<AddressAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_customerAttributeRepository,+ OrderBuilder<CustomerAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ await dbContext.CreateIndex(_customerHistoryPasswordRepository,+ OrderBuilder<CustomerHistoryPassword>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //product customer group+ await dbContext.CreateIndex(_customerGroupProductRepository,+ OrderBuilder<CustomerGroupProduct>.Create().Ascending(x => x.CustomerGroupId)+ .Ascending(x => x.DisplayOrder), "CustomerGroupId_DisplayOrder");+ await dbContext.CreateIndex(_customerGroupProductRepository,+ OrderBuilder<CustomerGroupProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //customer personalize product+ await dbContext.CreateIndex(_customerProductRepository,+ OrderBuilder<CustomerProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.DisplayOrder),+ "CustomerProduct");+ await dbContext.CreateIndex(_customerProductRepository,+ OrderBuilder<CustomerProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId),+ "CustomerProduct_Unique", true);+ await dbContext.CreateIndex(_customerProductRepository,+ OrderBuilder<CustomerProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //customer product price+ await dbContext.CreateIndex(_customerProductPriceRepository,+ OrderBuilder<CustomerProductPrice>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId),+ "CustomerProduct", true);++ //customer tag history+ await dbContext.CreateIndex(_customerTagProductRepository,+ OrderBuilder<CustomerTagProduct>.Create().Ascending(x => x.Id).Ascending(x => x.DisplayOrder),+ "CustomerTagId_DisplayOrder");+ await dbContext.CreateIndex(_customerTagProductRepository,+ OrderBuilder<CustomerTagProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //customer history password+ await dbContext.CreateIndex(_customerHistoryPasswordRepository,+ OrderBuilder<CustomerHistoryPassword>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc),+ "CustomerId");++ //customer note+ await dbContext.CreateIndex(_customerNoteRepository,+ OrderBuilder<CustomerNote>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc),+ "CustomerId");+ await dbContext.CreateIndex(_customerNoteRepository,+ OrderBuilder<CustomerNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //user api+ await dbContext.CreateIndex(_userapiRepository, OrderBuilder<UserApi>.Create().Ascending(x => x.Email), "Email",+ true);++ //specificationAttribute+ await dbContext.CreateIndex(_specificationAttributeRepository,+ OrderBuilder<SpecificationAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //checkoutAttribute+ await dbContext.CreateIndex(_checkoutAttributeRepository,+ OrderBuilder<CheckoutAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //contact attr+ await dbContext.CreateIndex(_contactAttributeRepository,+ OrderBuilder<ContactAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //category+ await dbContext.CreateIndex(_categoryRepository,+ OrderBuilder<Category>.Create().Ascending(x => x.Published).Ascending(x => x.ShowOnHomePage)+ .Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");+ await dbContext.CreateIndex(_categoryRepository,+ OrderBuilder<Category>.Create().Ascending(x => x.ParentCategoryId).Ascending(x => x.Published)+ .Ascending(x => x.DisplayOrder), "ParentCategoryId_1_DisplayOrder_1");+ await dbContext.CreateIndex(_categoryRepository,+ OrderBuilder<Category>.Create().Ascending(x => x.FeaturedProductsOnHomePage).Ascending(x => x.Published)+ .Ascending(x => x.DisplayOrder), "FeaturedProductsOnHomePage_DisplayOrder_1");+ await dbContext.CreateIndex(_categoryRepository,+ OrderBuilder<Category>.Create().Ascending(x => x.SearchBoxDisplayOrder), "SearchBoxDisplayOrder");+ await dbContext.CreateIndex(_categoryRepository,+ OrderBuilder<Category>.Create().Ascending(x => x.ParentCategoryId).Ascending(x => x.DisplayOrder)+ .Ascending(x => x.Name), "ParentCategoryId_1_DisplayOrder_1_Name_1");++ await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.DisplayOrder),+ "DisplayOrder_1");++ //collection+ await dbContext.CreateIndex(_collectionRepository,+ OrderBuilder<Collection>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name),+ "DisplayOrder_Name");+ await dbContext.CreateIndex(_collectionRepository,+ OrderBuilder<Collection>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_collectionRepository,+ OrderBuilder<Collection>.Create().Ascending(x => x.ShowOnHomePage).Ascending(x => x.Published)+ .Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");+ await dbContext.CreateIndex(_collectionRepository,+ OrderBuilder<Collection>.Create().Ascending(x => x.AppliedDiscounts), "AppliedDiscounts");++ //brands+ await dbContext.CreateIndex(_brandRepository,+ OrderBuilder<Brand>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");+ await dbContext.CreateIndex(_brandRepository,+ OrderBuilder<Brand>.Create().Ascending(x => x.ShowOnHomePage).Ascending(x => x.Published)+ .Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");+ await dbContext.CreateIndex(_brandRepository, OrderBuilder<Brand>.Create().Ascending(x => x.AppliedDiscounts),+ "AppliedDiscounts");++ //Product+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.MarkAsNew).Ascending(x => x.CreatedOnUtc),+ "MarkAsNew_1_CreatedOnUtc_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.ShowOnHomePage)+ .Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "ShowOnHomePage_1_Published_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.BestSeller)+ .Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "ShowOnBestSeller_1_Published_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.ParentGroupedProductId).Ascending(x => x.DisplayOrder),+ "ParentGroupedProductId_1_DisplayOrder_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.ProductTags).Ascending(x => x.Published)+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.Name), "ProductTags._id_1_Name_1");+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Name),+ "Name_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending("ProductCategories.DisplayOrder"), "CategoryId_1_DisplayOrder_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)+ .Ascending(x => x.DisplayOrderCategory).Ascending("ProductCategories.CategoryId"),+ "ProductCategories.CategoryId_1_OrderCategory_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)+ .Ascending(x => x.Name).Ascending("ProductCategories.CategoryId"),+ "ProductCategories.CategoryId_1_Name_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)+ .Ascending(x => x.Price).Ascending("ProductCategories.CategoryId"),+ "ProductCategories.CategoryId_1_Price_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)+ .Ascending(x => x.Sold).Ascending("ProductCategories.CategoryId"),+ "ProductCategories.CategoryId_1_Sold_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)+ .Ascending("ProductCategories.CategoryId").Ascending("ProductCategories.IsFeaturedProduct"),+ "ProductCategories.CategoryId_1_IsFeaturedProduct_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published)+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.DisplayOrderCollection),+ "ProductCollections.CollectionId_1_OrderCategory_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published)+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.Name),+ "ProductCollections.CollectionId_1_Name_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published)+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.Sold),+ "ProductCollections.CollectionId_1_Sold_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId")+ .Ascending("ProductCollections.IsFeaturedProduct").Ascending(x => x.Published)+ .Ascending(x => x.VisibleIndividually), "ProductCollections.CollectionId_1_IsFeaturedProduct_1");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)+ .Ascending(x => x.BrandId).Ascending(x => x.DisplayOrderBrand), "ProductBrand");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)+ .Ascending("ProductSpecificationAttributes.SpecificationAttributeOptionId")+ .Ascending("ProductSpecificationAttributes.AllowFiltering"), "ProductSpecificationAttributes");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");++ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderCategory), "DisplayOrderCategory");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderBrand), "DisplayOrderBrand");+ await dbContext.CreateIndex(_productRepository,+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderCollection), "DisplayOrderCollection");+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrder),+ "DisplayOrder");+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Price),+ "Price");+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.CreatedOnUtc),+ "CreatedOnUtc");+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.OnSale),+ "OnSale");+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Viewed),+ "Viewed");+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Sold), "Sold");++ //product attribute+ await dbContext.CreateIndex(_productAttributeRepository,+ OrderBuilder<ProductAttribute>.Create().Ascending(x => x.Name), "Name");++ //Product layout+ await dbContext.CreateIndex(_productLayoutRepository,+ OrderBuilder<ProductLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_categoryLayoutRepository,+ OrderBuilder<CategoryLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_brandLayoutRepository,+ OrderBuilder<BrandLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_collectionLayoutRepository,+ OrderBuilder<CollectionLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_pageLayoutRepository,+ OrderBuilder<PageLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //Delivery date+ await dbContext.CreateIndex(_deliveryDateRepository,+ OrderBuilder<DeliveryDate>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //Tax+ await dbContext.CreateIndex(_taxCategoryRepository,+ OrderBuilder<TaxCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //Measure+ await dbContext.CreateIndex(_measureWeightRepository,+ OrderBuilder<MeasureWeight>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_measureUnitRepository,+ OrderBuilder<MeasureUnit>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_measureDimensionRepository,+ OrderBuilder<MeasureDimension>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //productreseration+ await dbContext.CreateIndex(_productReservationRepository,+ OrderBuilder<ProductReservation>.Create().Ascending(x => x.ProductId).Ascending(x => x.Date),+ "ProductReservation");+ await dbContext.CreateIndex(_productReservationRepository,+ OrderBuilder<ProductReservation>.Create().Ascending(x => x.Date), "Date");++ //bid+ await dbContext.CreateIndex(_bidRepository,+ OrderBuilder<Bid>.Create().Ascending(x => x.ProductId).Ascending(x => x.CustomerId).Descending(x => x.Date),+ "ProductCustomer");+ await dbContext.CreateIndex(_bidRepository,+ OrderBuilder<Bid>.Create().Ascending(x => x.ProductId).Descending(x => x.Date), "ProductDate");+ await dbContext.CreateIndex(_bidRepository, OrderBuilder<Bid>.Create().Descending(x => x.Date), "Date");++ //ProductReview+ await dbContext.CreateIndex(_productReviewRepository,+ OrderBuilder<ProductReview>.Create().Ascending(x => x.ProductId).Ascending(x => x.CreatedOnUtc),+ "ProductId");+ await dbContext.CreateIndex(_productReviewRepository,+ OrderBuilder<ProductReview>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //Recently Viewed Products+ await dbContext.CreateIndex(_recentlyViewedProductRepository,+ OrderBuilder<RecentlyViewedProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId)+ .Descending(x => x.CreatedOnUtc), "CustomerId.ProductId");+ await dbContext.CreateIndex(_recentlyViewedProductRepository,+ OrderBuilder<RecentlyViewedProduct>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //Product also purchased+ await dbContext.CreateIndex(_productalsopurchasedRepository,+ OrderBuilder<ProductAlsoPurchased>.Create().Ascending(x => x.ProductId), "ProductId");++ //url record+ await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.Slug),+ "Slug");+ await dbContext.CreateIndex(_entityUrlRepository,+ OrderBuilder<EntityUrl>.Create().Ascending(x => x.Slug).Ascending(x => x.IsActive), "SlugActive");+ await dbContext.CreateIndex(_entityUrlRepository,+ OrderBuilder<EntityUrl>.Create().Ascending(x => x.EntityId).Ascending(x => x.EntityName)+ .Ascending(x => x.LanguageId).Ascending(x => x.IsActive), "UrlEntity");+ await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.IsActive),+ "IsActive");++ //message template+ await dbContext.CreateIndex(_messageTemplateRepository,+ OrderBuilder<MessageTemplate>.Create().Ascending(x => x.Name), "Name");++ // Country and Stateprovince+ await dbContext.CreateIndex(_countryRepository, OrderBuilder<Country>.Create().Ascending(x => x.DisplayOrder),+ "DisplayOrder");++ //discount+ await dbContext.CreateIndex(_discountRepository, OrderBuilder<Discount>.Create().Ascending(x => x.Name),+ "Name)");++ await dbContext.CreateIndex(_discountCouponRepository,+ OrderBuilder<DiscountCoupon>.Create().Ascending(x => x.CouponCode), "CouponCode", true);+ await dbContext.CreateIndex(_discountCouponRepository,+ OrderBuilder<DiscountCoupon>.Create().Ascending(x => x.DiscountId), "DiscountId");++ await dbContext.CreateIndex(_discountusageRepository,+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.CustomerId), "CustomerId");+ await dbContext.CreateIndex(_discountusageRepository,+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.DiscountId), "DiscountId");+ await dbContext.CreateIndex(_discountusageRepository,+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.OrderId), "OrderId");++ await dbContext.CreateIndex(_discountusageRepository,+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //blog+ await dbContext.CreateIndex(_blogPostRepository,+ OrderBuilder<BlogPost>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");+ await dbContext.CreateIndex(_blogCategoryRepository,+ OrderBuilder<BlogCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_blogCommentRepository,+ OrderBuilder<BlogComment>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //knowledgebase+ await dbContext.CreateIndex(_knowledgebaseArticleRepository,+ OrderBuilder<KnowledgebaseArticle>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_knowledgebaseCategoryRepository,+ OrderBuilder<KnowledgebaseCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_knowledgebaseCategoryRepository,+ OrderBuilder<KnowledgebaseCategory>.Create().Ascending(x => x.ParentCategoryId)+ .Ascending(x => x.DisplayOrder), "ParentCategoryId_DisplayOrder");++ //page+ await dbContext.CreateIndex(_pageRepository, OrderBuilder<Page>.Create().Ascending(x => x.SystemName),+ "SystemName");++ //news+ await dbContext.CreateIndex(_newsItemRepository, OrderBuilder<NewsItem>.Create().Ascending(x => x.CreatedOnUtc),+ "CreatedOnUtc");++ //newsletter+ await dbContext.CreateIndex(_newslettersubscriptionRepository,+ OrderBuilder<NewsLetterSubscription>.Create().Ascending(x => x.CustomerId), "CustomerId");+ await dbContext.CreateIndex(_newslettersubscriptionRepository,+ OrderBuilder<NewsLetterSubscription>.Create().Ascending(x => x.Email), "Email");++ //Campaign+ await dbContext.CreateIndex(_campaignRepository, OrderBuilder<Campaign>.Create().Ascending(x => x.CreatedOnUtc),+ "CreatedOnUtc");+ await dbContext.CreateIndex(_campaignHistoryRepository,+ OrderBuilder<CampaignHistory>.Create().Ascending(x => x.CampaignId).Descending(x => x.CreatedDateUtc),+ "CampaignId");++ //loyalty points+ await dbContext.CreateIndex(_loyaltypointshistoryRepository,+ OrderBuilder<LoyaltyPointsHistory>.Create().Ascending(x => x.CustomerId), "CustomerId");+ await dbContext.CreateIndex(_loyaltypointshistoryRepository,+ OrderBuilder<LoyaltyPointsHistory>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //giftvoucher+ await dbContext.CreateIndex(_giftVoucherRepository,+ OrderBuilder<GiftVoucher>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //search term+ await dbContext.CreateIndex(_searchtermRepository, OrderBuilder<SearchTerm>.Create().Descending(x => x.Count),+ "Count");++ //setting+ await dbContext.CreateIndex(_settingRepository, OrderBuilder<Setting>.Create().Ascending(x => x.Name), "Name");++ //shipment+ await dbContext.CreateIndex(_shipmentRepository,+ OrderBuilder<Shipment>.Create().Ascending(x => x.ShipmentNumber), "ShipmentNumber", true);+ await dbContext.CreateIndex(_shipmentRepository, OrderBuilder<Shipment>.Create().Ascending(x => x.OrderId),+ "OrderId");+ await dbContext.CreateIndex(_shipmentRepository,+ OrderBuilder<Shipment>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ await dbContext.CreateIndex(_shipmentNoteRepository,+ OrderBuilder<ShipmentNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //order+ await dbContext.CreateIndex(_orderRepository,+ OrderBuilder<Order>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc),+ "CustomerId_1_CreatedOnUtc_-1");+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Descending(x => x.CreatedOnUtc),+ "CreatedOnUtc_-1");+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Descending(x => x.OrderNumber),+ "OrderNumber");+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending(x => x.Code), "OrderCode");+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending("OrderItems.ProductId"),+ "OrderItemProductId");+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending("OrderItems.Id"),+ "OrderItems._id");++ await dbContext.CreateIndex(_orderStatusRepository,+ OrderBuilder<OrderStatus>.Create().Ascending(x => x.StatusId), "StatusId", true);++ await dbContext.CreateIndex(_orderNoteRepository,+ OrderBuilder<OrderNote>.Create().Ascending(x => x.OrderId).Descending(x => x.CreatedOnUtc),+ "OrderId_Created");+ await dbContext.CreateIndex(_orderNoteRepository,+ OrderBuilder<OrderNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //payments+ await dbContext.CreateIndex(_paymentTransactionRepository,+ OrderBuilder<PaymentTransaction>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //queuemail+ await dbContext.CreateIndex(_queuedEmailRepository,+ OrderBuilder<QueuedEmail>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");+ await dbContext.CreateIndex(_queuedEmailRepository,+ OrderBuilder<QueuedEmail>.Create().Descending(x => x.PriorityId).Ascending(x => x.CreatedOnUtc),+ "PriorityId_CreatedOnUtc");++ //permision+ await dbContext.CreateIndex(_permissionRepository,+ OrderBuilder<Permission>.Create().Ascending(x => x.SystemName), "SystemName", true);+ await dbContext.CreateIndex(_permissionRepository, OrderBuilder<Permission>.Create().Ascending(x => x.Name),+ "Name");++ await dbContext.CreateIndex(_permissionAction,+ OrderBuilder<PermissionAction>.Create().Ascending(x => x.SystemName), "SystemName");++ //externalauth+ await dbContext.CreateIndex(_externalAuthenticationRepository,+ OrderBuilder<ExternalAuthentication>.Create().Ascending(x => x.CustomerId), "CustomerId");++ //merchandise return+ await dbContext.CreateIndex(_merchandiseReturnRepository,+ OrderBuilder<MerchandiseReturn>.Create().Ascending(x => x.ReturnNumber), "ReturnNumber", true);+ await dbContext.CreateIndex(_merchandiseReturnRepository,+ OrderBuilder<MerchandiseReturn>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");+ await dbContext.CreateIndex(_merchandiseReturnActionRepository,+ OrderBuilder<MerchandiseReturnAction>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_merchandiseReturnReasonRepository,+ OrderBuilder<MerchandiseReturnReason>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ await dbContext.CreateIndex(_merchandiseReturnNoteRepository,+ OrderBuilder<MerchandiseReturnNote>.Create().Ascending(x => x.MerchandiseReturnId)+ .Descending(x => x.CreatedOnUtc), "MerchandiseReturnId_CreatedOn");+ await dbContext.CreateIndex(_merchandiseReturnNoteRepository,+ OrderBuilder<MerchandiseReturnNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //contactus+ await dbContext.CreateIndex(_contactUsRepository, OrderBuilder<ContactUs>.Create().Ascending(x => x.Email),+ "Email");+ await dbContext.CreateIndex(_contactUsRepository,+ OrderBuilder<ContactUs>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //page+ await dbContext.CreateIndex(_pageRepository,+ OrderBuilder<Page>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.SystemName),+ "DisplayOrder_SystemName");++ //warehouse+ await dbContext.CreateIndex(_warehouseRepository,+ OrderBuilder<Warehouse>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //shipping method+ await dbContext.CreateIndex(_shippingMethodRepository,+ OrderBuilder<ShippingMethod>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //order status+ await dbContext.CreateIndex(_orderStatusRepository,+ OrderBuilder<OrderStatus>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //country+ await dbContext.CreateIndex(_countryRepository,+ OrderBuilder<Country>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");++ //picpup points+ await dbContext.CreateIndex(_pickupPointRepository,+ OrderBuilder<PickupPoint>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //outofstock+ await dbContext.CreateIndex(_outOfStockSubscriptionRepository,+ OrderBuilder<OutOfStockSubscription>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");++ //document+ await dbContext.CreateIndex(_documentTypeRepository,+ OrderBuilder<DocumentType>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");+ await dbContext.CreateIndex(_documentTypeRepository,+ OrderBuilder<DocumentType>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //sales+ await dbContext.CreateIndex(_salesRepository,+ OrderBuilder<SalesEmployee>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //newslettercategory+ await dbContext.CreateIndex(_newsletterCategoryRepository,+ OrderBuilder<NewsletterCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //course+ await dbContext.CreateIndex(_courseRepository, OrderBuilder<Course>.Create().Ascending(x => x.CreatedOnUtc),+ "CreatedOnUtc");+ await dbContext.CreateIndex(_courseLevelRepository,+ OrderBuilder<CourseLevel>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //admin site map+ await dbContext.CreateIndex(_adminRepository,+ OrderBuilder<AdminSiteMap>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");++ //if(dataSettings.DbProvider == DbProvider.CosmosDB)+ //{+ // //+ // //db.fs.chunks.createIndex({'n': 1})+ // //To Fix problem with download files from GridFSBucket+ // //+ //}+ }- private async Task CreateTables(string local)+ private async Task CreateTables(string local)+ {+ try{- try- {- var dataSettings = DataSettingsManager.LoadSettings(reloadSettings: true);- var dbContext = _serviceProvider.GetRequiredService<IDatabaseContext>();- dbContext.SetConnection(dataSettings.ConnectionString);-- if (dbContext.InstallProcessCreateTable)- {- var typeSearcher = _serviceProvider.GetRequiredService<ITypeSearcher>();- var q = typeSearcher.GetAssemblies().FirstOrDefault(x => x.GetName().Name == "Grand.Domain");+ var dataSettings = DataSettingsManager.LoadSettings(true);+ var dbContext = _serviceProvider.GetRequiredService<IDatabaseContext>();+ dbContext.SetConnection(dataSettings.ConnectionString);- foreach (var item in q.GetTypes())- {- if (item.BaseType != null && item.IsClass && item.BaseType == typeof(BaseEntity))- await dbContext.CreateTable(item.Name, local);- }- }-- if (dbContext.InstallProcessCreateIndex)- await CreateIndexes(dbContext, dataSettings);-- }- catch (Exception ex)+ if (dbContext.InstallProcessCreateTable){- throw new GrandException(ex.Message);- }- }-- #endregion-- #region Methods+ var typeSearcher = _serviceProvider.GetRequiredService<ITypeSearcher>();+ var q = typeSearcher.GetAssemblies().FirstOrDefault(x => x.GetName().Name == "Grand.Domain");+ foreach (var item in q.GetTypes())+ if (item.BaseType != null && item.IsClass && item.BaseType == typeof(BaseEntity))+ await dbContext.CreateTable(item.Name, local);+ }- public virtual async Task InstallData(string httpscheme, HostString host, string defaultUserEmail,- string defaultUserPassword, string collation, bool installSampleData = true, string companyName = "", string companyAddress = "",- string companyPhoneNumber = "", string companyEmail = "")+ if (dbContext.InstallProcessCreateIndex)+ await CreateIndexes(dbContext, dataSettings);+ }+ catch (Exception ex){- defaultUserEmail = defaultUserEmail.ToLower();-- await CreateTables(collation);- await InstallVersion();- await InstallMenuAdminSiteMap();- await InstallStores(httpscheme, host, companyName, companyAddress, companyPhoneNumber, companyEmail);- await InstallMeasures();- await InstallTaxCategories();- await InstallLanguages();- await InstallCurrencies();- await InstallCountriesAndStates();- await InstallShippingMethods();- await InstallDeliveryDates();- await InstallCustomersAndUsers(defaultUserEmail, defaultUserPassword);- await InstallEmailAccounts();- await InstallMessageTemplates();- await InstallSettings(installSampleData);- await InstallPageLayouts();- await InstallPages();- await InstallLocaleResources();- await HashDefaultCustomerPassword(defaultUserEmail, defaultUserPassword);- await InstallProductLayouts();- await InstallCategoryLayouts();- await InstallBrandLayouts();- await InstallCollectionLayouts();- await InstallScheduleTasks();- await InstallMerchandiseReturnReasons();- await InstallMerchandiseReturnActions();- await InstallOrderStatus();- if (installSampleData)- {- await InstallCheckoutAttributes();- await InstallSpecificationAttributes();- await InstallProductAttributes();- await InstallCategories();- await InstallBrands();- await InstallProducts(defaultUserEmail);- await InstallDiscounts();- await InstallBlogPosts();- await InstallNews();- await InstallWarehouses();- await InstallPickupPoints();- await InstallVendors();- await InstallAffiliates();- await InstallOrderTags();- }+ throw new GrandException(ex.Message);}--- #endregion-}-}++ #endregion+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/MachineNameProvider/AzureWebAppsMachineNameProvider.cs b/src/Business/Grand.Business.System/Services/MachineNameProvider/AzureWebAppsMachineNameProvider.csindex ee216975c..126f6789d 100644--- a/src/Business/Grand.Business.System/Services/MachineNameProvider/AzureWebAppsMachineNameProvider.cs+++ b/src/Business/Grand.Business.System/Services/MachineNameProvider/AzureWebAppsMachineNameProvider.cs@@ -1,27 +1,27 @@//Contribution: Orchard project (http://www.orchardproject.net/)+using Grand.Business.Core.Interfaces.System.MachineNameProvider;-namespace Grand.Business.System.Services.MachineNameProvider+namespace Grand.Business.System.Services.MachineNameProvider;++/// <summary>+/// Azure websites machine name provider+/// </summary>+public class AzureWebAppsMachineNameProvider : IMachineNameProvider{/// <summary>- /// Azure websites machine name provider+ /// Returns the name of the machine (instance) running the application./// </summary>- public class AzureWebAppsMachineNameProvider : IMachineNameProvider+ public string GetMachineName(){- /// <summary>- /// Returns the name of the machine (instance) running the application.- /// </summary>- public string GetMachineName()- {- //use the code below if run on Windows Azure cloud services (web roles)- //return Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CurrentRoleInstance.Id;- var name = Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");- if (string.IsNullOrEmpty(name))- name = Environment.MachineName;+ //use the code below if run on Windows Azure cloud services (web roles)+ //return Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CurrentRoleInstance.Id;+ var name = Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");+ if (string.IsNullOrEmpty(name))+ name = Environment.MachineName;- //you can also use ARR affinity cookie in order to detect instance name+ //you can also use ARR affinity cookie in order to detect instance name- return name;- }+ return name;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/MachineNameProvider/DefaultMachineNameProvider.cs b/src/Business/Grand.Business.System/Services/MachineNameProvider/DefaultMachineNameProvider.csindex b3f27290e..8b11d2ed8 100644--- a/src/Business/Grand.Business.System/Services/MachineNameProvider/DefaultMachineNameProvider.cs+++ b/src/Business/Grand.Business.System/Services/MachineNameProvider/DefaultMachineNameProvider.cs@@ -1,19 +1,19 @@//Contribution: Orchard project (http://www.orchardproject.net/)+using Grand.Business.Core.Interfaces.System.MachineNameProvider;-namespace Grand.Business.System.Services.MachineNameProvider+namespace Grand.Business.System.Services.MachineNameProvider;++/// <summary>+/// Default machine name provider+/// </summary>+public class DefaultMachineNameProvider : IMachineNameProvider{/// <summary>- /// Default machine name provider+ /// Returns the name of the machine (instance) running the application./// </summary>- public class DefaultMachineNameProvider : IMachineNameProvider+ public string GetMachineName(){- /// <summary>- /// Returns the name of the machine (instance) running the application.- /// </summary>- public string GetMachineName()- {- return Environment.MachineName;- }+ return Environment.MachineName;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.csindex 71c9573fd..dd6419101 100644--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.cs@@ -1,54 +1,54 @@using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Utilities.Common.Security;-using Grand.Domain.Customers;using Grand.Data;+using Grand.Domain.Customers;using Grand.Domain.Permissions;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._1._1+namespace Grand.Business.System.Services.Migrations._1._1;++public class MigrationSystemPermission : IMigration{- public class MigrationSystemPermission : IMigration+ public int Priority => 0;+ public DbVersion Version => new(1, 1);+ public Guid Identity => new("361F2D87-D067-44FE-B0A6-0817B201730A");+ public string Name => "Install new permission - System";++ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider){- public int Priority => 0;- public DbVersion Version => new(1, 1);- public Guid Identity => new("361F2D87-D067-44FE-B0A6-0817B201730A");- public string Name => "Install new permission - System";+ var repository = serviceProvider.GetRequiredService<IRepository<Permission>>();+ var groupService = serviceProvider.GetRequiredService<IGroupService>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationSystemPermission>>();- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Permission>>();- var groupService = serviceProvider.GetRequiredService<IGroupService>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationSystemPermission>>();-- try+ var permission = repository.Table.FirstOrDefault(x => x.SystemName == PermissionSystemName.System);+ if (permission == null){- var permission = repository.Table.FirstOrDefault(x => x.SystemName == PermissionSystemName.System);- if (permission == null)- {- permission = new Permission {- Name = "Manage System",- SystemName = PermissionSystemName.System,- Area = "Admin area",- Category = "System"-- };- permission.CustomerGroups.Add(groupService.GetCustomerGroupBySystemName(SystemCustomerGroupNames.Administrators).GetAwaiter().GetResult().Id);- repository.Insert(permission);- }+ permission = new Permission {+ Name = "Manage System",+ SystemName = PermissionSystemName.System,+ Area = "Admin area",+ Category = "System"+ };+ permission.CustomerGroups.Add(groupService+ .GetCustomerGroupBySystemName(SystemCustomerGroupNames.Administrators).GetAwaiter().GetResult().Id);+ repository.Insert(permission);}- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");- }- return true;}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.csindex 2cae97f07..7eec8e260 100644--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.cs@@ -1,94 +1,100 @@using Grand.Business.Core.Utilities.Common.Security;using Grand.Data;+using Grand.Domain.Admin;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._1._1+namespace Grand.Business.System.Services.Migrations._1._1;++public class MigrationUpdateAdminSiteMap : IMigration{- public class MigrationUpdateAdminSiteMap : IMigration- {+ public int Priority => 0;+ public DbVersion Version => new(1, 1);+ public Guid Identity => new("91249F73-CBD2-4007-B2B9-884727279D57");+ public string Name => "Update standard admin site map";- public int Priority => 0;- public DbVersion Version => new(1, 1);- public Guid Identity => new("91249F73-CBD2-4007-B2B9-884727279D57");- public string Name => "Update standard admin site map";+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<AdminSiteMap>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateAdminSiteMap>>();- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Domain.Admin.AdminSiteMap>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateAdminSiteMap>>();-- try+ var sitemapSystem = repository.Table.FirstOrDefault(x => x.SystemName == "System");+ if (sitemapSystem != null){- var sitemapSystem = repository.Table.FirstOrDefault(x => x.SystemName == "System");- if (sitemapSystem != null)+ sitemapSystem.PermissionNames = new List<string> {+ PermissionSystemName.MessageQueue, PermissionSystemName.MessageContactForm,+ PermissionSystemName.Maintenance, PermissionSystemName.ScheduleTasks, PermissionSystemName.System+ };+ var childnodeDevTools = sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Developer tools");+ if (childnodeDevTools != null){- sitemapSystem.PermissionNames = new List<string> { PermissionSystemName.MessageQueue, PermissionSystemName.MessageContactForm,- PermissionSystemName.Maintenance, PermissionSystemName.ScheduleTasks, PermissionSystemName.System };- var childnodeDevTools = sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Developer tools");- if (childnodeDevTools != null)+ childnodeDevTools.PermissionNames = new List<string>+ { PermissionSystemName.Maintenance, PermissionSystemName.System };+ var childnodeRoslyn =+ childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Roslyn compiler");+ if (childnodeRoslyn != null){- childnodeDevTools.PermissionNames = new List<string> { PermissionSystemName.Maintenance, PermissionSystemName.System };- var childnodeRoslyn = childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Roslyn compiler");- if (childnodeRoslyn != null)- {- childnodeRoslyn.PermissionNames = new List<string> { PermissionSystemName.System };- childnodeRoslyn.ControllerName = "System";- }- var childnodeSysInformation = sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "System information");- if (childnodeSysInformation != null)- {- childnodeSysInformation.ControllerName = "System";- childnodeSysInformation.PermissionNames = new List<string> { PermissionSystemName.System };- }-- var childnodeCss = childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Custom css");- if (childnodeCss != null)- childnodeCss.ControllerName = "Maintenance";-- var childnodeJs = childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Custom JS");- if (childnodeJs != null)- childnodeJs.ControllerName = "Maintenance";+ childnodeRoslyn.PermissionNames = new List<string> { PermissionSystemName.System };+ childnodeRoslyn.ControllerName = "System";+ }- var childnodeRobots = childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Robot.txt");- if (childnodeRobots != null)- {- childnodeRobots.ControllerName = "Maintenance";- childnodeRobots.ActionName = "RobotsTxt";- childnodeRobots.ResourceName = "Admin.System.RobotsTxt";- }+ var childnodeSysInformation =+ sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "System information");+ if (childnodeSysInformation != null)+ {+ childnodeSysInformation.ControllerName = "System";+ childnodeSysInformation.PermissionNames = new List<string> { PermissionSystemName.System };}-- var childnodeMaintenance = sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Maintenance");- if (childnodeMaintenance != null)- childnodeMaintenance.ControllerName = "Maintenance";- repository.Update(sitemapSystem);- }+ var childnodeCss = childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Custom css");+ if (childnodeCss != null)+ childnodeCss.ControllerName = "Maintenance";- var sitemapConfiguration = repository.Table.FirstOrDefault(x => x.SystemName == "Configuration");- if (sitemapConfiguration != null)- {- var childnodeSeo = sitemapConfiguration.ChildNodes.FirstOrDefault(x => x.SystemName == "Search engine friendly names");- if (childnodeSeo != null)- childnodeSeo.ControllerName = "Maintenance";+ var childnodeJs = childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Custom JS");+ if (childnodeJs != null)+ childnodeJs.ControllerName = "Maintenance";- repository.Update(sitemapConfiguration);+ var childnodeRobots = childnodeDevTools.ChildNodes.FirstOrDefault(x => x.SystemName == "Robot.txt");+ if (childnodeRobots != null)+ {+ childnodeRobots.ControllerName = "Maintenance";+ childnodeRobots.ActionName = "RobotsTxt";+ childnodeRobots.ResourceName = "Admin.System.RobotsTxt";+ }}+ var childnodeMaintenance = sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Maintenance");+ if (childnodeMaintenance != null)+ childnodeMaintenance.ControllerName = "Maintenance";++ repository.Update(sitemapSystem);}- catch (Exception ex)++ var sitemapConfiguration = repository.Table.FirstOrDefault(x => x.SystemName == "Configuration");+ if (sitemapConfiguration != null){- logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");+ var childnodeSeo =+ sitemapConfiguration.ChildNodes.FirstOrDefault(x => x.SystemName == "Search engine friendly names");+ if (childnodeSeo != null)+ childnodeSeo.ControllerName = "Maintenance";++ repository.Update(sitemapConfiguration);}- return true;}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateLogoSettings.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateLogoSettings.csindex 5f3093c13..5915c101d 100644--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateLogoSettings.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateLogoSettings.cs@@ -1,6 +1,7 @@using Grand.Business.Core.Interfaces.Common.Configuration;using Grand.Business.Core.Interfaces.Storage;using Grand.Data;+using Grand.Domain.Configuration;using Grand.Domain.Stores;using Grand.Infrastructure.Migrations;using Microsoft.AspNetCore.Hosting;@@ -9,62 +10,63 @@ using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;using System.Text.Json;-namespace Grand.Business.System.Services.Migrations._1._1+namespace Grand.Business.System.Services.Migrations._1._1;++public class MigrationUpdateLogoSettings : IMigration{- public class MigrationUpdateLogoSettings : IMigration- {+ public int Priority => 0;+ public DbVersion Version => new(1, 1);+ public Guid Identity => new("82A5E26A-7861-4C72-9D5E-AF95477CE1F7");+ public string Name => "Update logo settings - StoreInformationSettings";- public int Priority => 0;- public DbVersion Version => new(1, 1);- public Guid Identity => new("82A5E26A-7861-4C72-9D5E-AF95477CE1F7");- public string Name => "Update logo settings - StoreInformationSettings";+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<Setting>>();+ var storeSettings = repository.Table.Where(x => x.Name == "storeinformationsettings");+ var settingService = serviceProvider.GetRequiredService<ISettingService>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateLogoSettings>>();+ var hostingEnvironment = serviceProvider.GetRequiredService<IWebHostEnvironment>();- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ //update logo settings+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Domain.Configuration.Setting>>();- var storeSettings = repository.Table.Where(x => x.Name == "storeinformationsettings");- var settingService = serviceProvider.GetRequiredService<ISettingService>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateLogoSettings>>();- var hostingEnvironment = serviceProvider.GetRequiredService<IWebHostEnvironment>();-- //update logo settings- try+ foreach (var storeSetting in storeSettings){- foreach (var storeSetting in storeSettings)+ var metadata = storeSetting.Metadata;+ var settingsLogo = JsonSerializer.Deserialize<SettingsLogo>(metadata);+ if (settingsLogo != null && !string.IsNullOrEmpty(settingsLogo.LogoPicture)){- var metadata = storeSetting.Metadata;- var settingsLogo = JsonSerializer.Deserialize<SettingsLogo>(metadata);- if (settingsLogo != null && !string.IsNullOrEmpty(settingsLogo.LogoPicture))- {- var pictureService = serviceProvider.GetRequiredService<IPictureService>();- new FileExtensionContentTypeProvider().TryGetContentType(settingsLogo.LogoPicture, out var mimeType);+ var pictureService = serviceProvider.GetRequiredService<IPictureService>();+ new FileExtensionContentTypeProvider().TryGetContentType(settingsLogo.LogoPicture,+ out var mimeType);- var path = Path.Combine(hostingEnvironment.WebRootPath, settingsLogo.LogoPicture);+ var path = Path.Combine(hostingEnvironment.WebRootPath, settingsLogo.LogoPicture);- var pictureId = pictureService.InsertPicture(File.ReadAllBytes(path), mimeType, "").GetAwaiter().GetResult();- var storeInformationSettings = settingService.LoadSetting<StoreInformationSettings>(storeSetting.StoreId);- storeInformationSettings.LogoPictureId = pictureId?.Id;- settingService.SaveSetting<StoreInformationSettings>(storeInformationSettings, storeSetting.StoreId).GetAwaiter().GetResult();- }+ var pictureId = pictureService.InsertPicture(File.ReadAllBytes(path), mimeType, "").GetAwaiter()+ .GetResult();+ var storeInformationSettings =+ settingService.LoadSetting<StoreInformationSettings>(storeSetting.StoreId);+ storeInformationSettings.LogoPictureId = pictureId?.Id;+ settingService.SaveSetting(storeInformationSettings, storeSetting.StoreId).GetAwaiter().GetResult();}}- catch(Exception ex)- {- logService.LogError(ex, "UpgradeProcess - MigrationUpdateSettings");- }- return true;}-- private class SettingsLogo+ catch (Exception ex){- public string LogoPicture { get; set; }+ logService.LogError(ex, "UpgradeProcess - MigrationUpdateSettings");}+ return true;+ }++ private class SettingsLogo+ {+ public string LogoPicture { get; set; }}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateMediaSettings.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateMediaSettings.csindex bcc260691..627834fbe 100644--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateMediaSettings.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateMediaSettings.cs@@ -1,57 +1,55 @@using Grand.Business.Core.Interfaces.Common.Configuration;using Grand.Data;+using Grand.Domain.Configuration;using Grand.Domain.Media;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;using System.Text.Json;-namespace Grand.Business.System.Services.Migrations._1._1+namespace Grand.Business.System.Services.Migrations._1._1;++public class MigrationUpdateMediaSettings : IMigration{- public class MigrationUpdateMediaSettings : IMigration- {+ public int Priority => 0;+ public DbVersion Version => new(1, 1);+ public Guid Identity => new("899F6A9F-99BA-41C1-8E1F-9AE63A78E531");+ public string Name => "Update media settings - add new settings storage settings";- public int Priority => 0;- public DbVersion Version => new(1, 1);- public Guid Identity => new("899F6A9F-99BA-41C1-8E1F-9AE63A78E531");- public string Name => "Update media settings - add new settings storage settings";+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<Setting>>();+ var mediaSettings = repository.Table.FirstOrDefault(x => x.Name == "mediasettings");+ var settingService = serviceProvider.GetRequiredService<ISettingService>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateMediaSettings>>();- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Domain.Configuration.Setting>>();- var mediaSettings = repository.Table.FirstOrDefault(x => x.Name == "mediasettings");- var settingService = serviceProvider.GetRequiredService<ISettingService>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateMediaSettings>>();-- try- {- if (mediaSettings != null)- {- var metadata = mediaSettings.Metadata;- var settingsLogo = JsonSerializer.Deserialize<SettingsMedia>(metadata);- if (settingsLogo != null)- {- settingService.SaveSetting<StorageSettings>(new StorageSettings { PictureStoreInDb = settingsLogo.StoreInDb }, "").GetAwaiter().GetResult();- }- }- }- catch (Exception ex)+ if (mediaSettings != null){- logService.LogError(ex, "UpgradeProcess - MigrationUpdateMediaSettings");+ var metadata = mediaSettings.Metadata;+ var settingsLogo = JsonSerializer.Deserialize<SettingsMedia>(metadata);+ if (settingsLogo != null)+ settingService.SaveSetting(new StorageSettings { PictureStoreInDb = settingsLogo.StoreInDb })+ .GetAwaiter().GetResult();}- return true;}-- private class SettingsMedia+ catch (Exception ex){- public bool StoreInDb { get; set; }+ logService.LogError(ex, "UpgradeProcess - MigrationUpdateMediaSettings");}+ return true;+ }++ private class SettingsMedia+ {+ public bool StoreInDb { get; set; }}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateResourceString.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateResourceString.csindex a410aac39..ccbc50b2b 100644--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateResourceString.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateResourceString.cs@@ -1,24 +1,23 @@using Grand.Data;using Grand.Infrastructure.Migrations;-namespace Grand.Business.System.Services.Migrations._1._1+namespace Grand.Business.System.Services.Migrations._1._1;++public class MigrationUpdateResourceString : IMigration{- public class MigrationUpdateResourceString : IMigration- {- public int Priority => 0;- public DbVersion Version => new(1, 1);- public Guid Identity => new("5FE5E3D4-2783-4925-8727-A8D8F202E4B8");- public string Name => "Update resource string for english language";+ public int Priority => 0;+ public DbVersion Version => new(1, 1);+ public Guid Identity => new("5FE5E3D4-2783-4925-8727-A8D8F202E4B8");+ public string Name => "Update resource string for english language";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_110.xml");- }+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_110.xml");}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateStore.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateStore.csindex 9a2122141..114a72600 100644--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateStore.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateStore.cs@@ -4,48 +4,46 @@ using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._1._1+namespace Grand.Business.System.Services.Migrations._1._1;++public class MigrationUpdateStore : IMigration{- public class MigrationUpdateStore : IMigration- {- public int Priority => 0;- public DbVersion Version => new(1, 1);- public Guid Identity => new("31F803A6-4B54-42F5-9868-6115F51BA594");- public string Name => "Update store - add domains";+ public int Priority => 0;+ public DbVersion Version => new(1, 1);+ public Guid Identity => new("31F803A6-4B54-42F5-9868-6115F51BA594");+ public string Name => "Update store - add domains";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<Store>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateStore>>();+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Store>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateStore>>();- try- {- foreach (var store in repository.Table)+ foreach (var store in repository.Table)+ if (!store.Domains.Any()){- if (!store.Domains.Any())- {- var storeUri = new Uri(store.Url);- var httpscheme = store.SslEnabled ? "https" : "http";- var domain = new DomainHost {- HostName = storeUri.Authority,- Url = $"{httpscheme}://{storeUri.Authority}",- Primary = true- };- store.Domains.Add(domain);- repository.Update(store);- }+ var storeUri = new Uri(store.Url);+ var httpscheme = store.SslEnabled ? "https" : "http";+ var domain = new DomainHost {+ HostName = storeUri.Authority,+ Url = $"{httpscheme}://{storeUri.Authority}",+ Primary = true+ };+ store.Domains.Add(domain);+ repository.Update(store);}- }- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - MigrationUpdateStore");- }- return true;}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - MigrationUpdateStore");+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpgradeDbVersion_11.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpgradeDbVersion_11.csindex 8b7935f84..96d3c8991 100644--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpgradeDbVersion_11.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpgradeDbVersion_11.cs@@ -1,37 +1,35 @@-using Grand.Domain.Common;-using Grand.Data;+using Grand.Data;+using Grand.Domain.Common;using Grand.Infrastructure;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Migrations._1._1-{- public class MigrationUpgradeDbVersion_11 : IMigration- {+namespace Grand.Business.System.Services.Migrations._1._1;- public int Priority => 0;+public class MigrationUpgradeDbVersion_11 : IMigration+{+ public int Priority => 0;- public DbVersion Version => new(1, 1);+ public DbVersion Version => new(1, 1);- public Guid Identity => new("6BDB7093-4C31-4D78-9604-58188DF728D3");+ public Guid Identity => new("6BDB7093-4C31-4D78-9604-58188DF728D3");- public string Name => "Upgrade version of the database to 1.1";+ public string Name => "Upgrade version of the database to 1.1";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();- var dbversion = repository.Table.ToList().FirstOrDefault();- dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";- repository.Update(dbversion);+ var dbversion = repository.Table.ToList().FirstOrDefault();+ dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";+ repository.Update(dbversion);- return true;- }+ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpdateResourceString.cs b/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpdateResourceString.csindex b166ab417..45fc341c9 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpdateResourceString.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpdateResourceString.cs@@ -1,24 +1,23 @@using Grand.Data;using Grand.Infrastructure.Migrations;-namespace Grand.Business.System.Services.Migrations._2._0+namespace Grand.Business.System.Services.Migrations._2._0;++public class MigrationUpdateResourceString : IMigration{- public class MigrationUpdateResourceString : IMigration- {- public int Priority => 0;- public DbVersion Version => new(2, 0);- public Guid Identity => new("DC357BA8-B998-429A-8E22-9FE07BCB287D");- public string Name => "Update resource string for english language 2.0";+ public int Priority => 0;+ public DbVersion Version => new(2, 0);+ public Guid Identity => new("DC357BA8-B998-429A-8E22-9FE07BCB287D");+ public string Name => "Update resource string for english language 2.0";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_200.xml");- }+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_200.xml");}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpgradeDbVersion_20.cs b/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpgradeDbVersion_20.csindex fe50d24ef..8974fbc13 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpgradeDbVersion_20.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.0/MigrationUpgradeDbVersion_20.cs@@ -1,37 +1,35 @@-using Grand.Domain.Common;-using Grand.Data;+using Grand.Data;+using Grand.Domain.Common;using Grand.Infrastructure;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Migrations._2._0-{- public class MigrationUpgradeDbVersion_20 : IMigration- {+namespace Grand.Business.System.Services.Migrations._2._0;- public int Priority => 0;+public class MigrationUpgradeDbVersion_20 : IMigration+{+ public int Priority => 0;- public DbVersion Version => new(2, 0);+ public DbVersion Version => new(2, 0);- public Guid Identity => new("AEC3CF1F-4443-474A-B932-4F91D08C8F61");+ public Guid Identity => new("AEC3CF1F-4443-474A-B932-4F91D08C8F61");- public string Name => "Upgrade version of the database to 2.0";+ public string Name => "Upgrade version of the database to 2.0";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();- var dbversion = repository.Table.ToList().FirstOrDefault();- dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";- repository.Update(dbversion);+ var dbversion = repository.Table.ToList().FirstOrDefault();+ dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";+ repository.Update(dbversion);- return true;- }+ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationProductRating.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationProductRating.csindex b81dca830..c7112e9a1 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationProductRating.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationProductRating.cs@@ -1,45 +1,46 @@-using Grand.Domain.Catalog;-using Grand.Data;+using Grand.Data;+using Grand.Domain.Catalog;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._2._1-{- public class MigrationProductRating : IMigration- {+namespace Grand.Business.System.Services.Migrations._2._1;- public int Priority => 0;- public DbVersion Version => new(2, 1);- public Guid Identity => new("4AD1CA78-5FE4-4A6C-A70C-D2036FA32E3E");- public string Name => "Update average product rating";+public class MigrationProductRating : IMigration+{+ public int Priority => 0;+ public DbVersion Version => new(2, 1);+ public Guid Identity => new("4AD1CA78-5FE4-4A6C-A70C-D2036FA32E3E");+ public string Name => "Update average product rating";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var productRepository = serviceProvider.GetRequiredService<IRepository<Product>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationProductRating>>();+ try{- var productRepository = serviceProvider.GetRequiredService<IRepository<Product>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationProductRating>>();- try+ foreach (var product in productRepository.Table){- foreach (var product in productRepository.Table)- {- var update = UpdateBuilder<Product>.Create()- .Set(x => x.AvgRating, product.ApprovedTotalReviews == 0 ? 0 : Math.Round((double)product.ApprovedRatingSum / product.ApprovedTotalReviews, 2));+ var update = UpdateBuilder<Product>.Create()+ .Set(x => x.AvgRating,+ product.ApprovedTotalReviews == 0+ ? 0+ : Math.Round((double)product.ApprovedRatingSum / product.ApprovedTotalReviews, 2));- productRepository.UpdateOneAsync(x=>x.Id == product.Id, update).GetAwaiter().GetResult();- }- }- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - RemoveOldActivityLogType");+ productRepository.UpdateOneAsync(x => x.Id == product.Id, update).GetAwaiter().GetResult();}- return true;-}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - RemoveOldActivityLogType");+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationScheduleTasks.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationScheduleTasks.csindex a1693e5d7..0e9bbcbef 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationScheduleTasks.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationScheduleTasks.cs@@ -4,50 +4,44 @@ using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._2._1-{- public class MigrationScheduleTasks : IMigration- {+namespace Grand.Business.System.Services.Migrations._2._1;- public int Priority => 0;- public DbVersion Version => new(2, 1);- public Guid Identity => new("81E2C287-F5F2-4E52-B0B8-119D8D71D0C2");- public string Name => "Remove ScheduleTasks";+public class MigrationScheduleTasks : IMigration+{+ public int Priority => 0;+ public DbVersion Version => new(2, 1);+ public Guid Identity => new("81E2C287-F5F2-4E52-B0B8-119D8D71D0C2");+ public string Name => "Remove ScheduleTasks";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<ScheduleTask>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationScheduleTasks>>();+ try{- var repository = serviceProvider.GetRequiredService<IRepository<ScheduleTask>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationScheduleTasks>>();- try- {- var scheduleTasks = repository- .Table.Where(x =>- x.ScheduleTaskName == "Customer reminder - AbandonedCart" ||- x.ScheduleTaskName == "Customer reminder - RegisteredCustomer" ||- x.ScheduleTaskName == "Customer reminder - LastActivity" ||- x.ScheduleTaskName == "Customer reminder - LastPurchase" ||- x.ScheduleTaskName == "Customer reminder - Birthday" ||- x.ScheduleTaskName == "Customer reminder - Completed order" ||- x.ScheduleTaskName == "Customer reminder - Unpaid order"- );- foreach (var item in scheduleTasks)- {- repository.Delete(item);- }-- }- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - RemoveOldScheduleTasks");- }- return true;-+ var scheduleTasks = repository+ .Table.Where(x =>+ x.ScheduleTaskName == "Customer reminder - AbandonedCart" ||+ x.ScheduleTaskName == "Customer reminder - RegisteredCustomer" ||+ x.ScheduleTaskName == "Customer reminder - LastActivity" ||+ x.ScheduleTaskName == "Customer reminder - LastPurchase" ||+ x.ScheduleTaskName == "Customer reminder - Birthday" ||+ x.ScheduleTaskName == "Customer reminder - Completed order" ||+ x.ScheduleTaskName == "Customer reminder - Unpaid order"+ );+ foreach (var item in scheduleTasks) repository.Delete(item);+ }+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - RemoveOldScheduleTasks");}++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationSystemPermission.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationSystemPermission.csindex 212aacd84..03cb483d0 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationSystemPermission.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationSystemPermission.cs@@ -4,38 +4,37 @@ using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._2._1+namespace Grand.Business.System.Services.Migrations._2._1;++public class MigrationSystemPermission : IMigration{- public class MigrationSystemPermission : IMigration- {- public int Priority => 0;- public DbVersion Version => new(2, 1);- public Guid Identity => new("D5FA1ACE-34A5-4CE4-A4CE-6A6DE2CEFFD2");- public string Name => "Remove old permissions";+ public int Priority => 0;+ public DbVersion Version => new(2, 1);+ public Guid Identity => new("D5FA1ACE-34A5-4CE4-A4CE-6A6DE2CEFFD2");+ public string Name => "Remove old permissions";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<Permission>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationSystemPermission>>();+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Permission>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationSystemPermission>>();- try- {- var permissionManageActions = repository.Table.FirstOrDefault(x => x.SystemName == "ManageActions");- if (permissionManageActions != null) repository.Delete(permissionManageActions);- var permissionManageReminders = repository.Table.FirstOrDefault(x => x.SystemName == "ManageReminders");- if (permissionManageReminders != null) repository.Delete(permissionManageReminders);-- }- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - RemoveOldPermissions");- }- return true;+ var permissionManageActions = repository.Table.FirstOrDefault(x => x.SystemName == "ManageActions");+ if (permissionManageActions != null) repository.Delete(permissionManageActions);+ var permissionManageReminders = repository.Table.FirstOrDefault(x => x.SystemName == "ManageReminders");+ if (permissionManageReminders != null) repository.Delete(permissionManageReminders);}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - RemoveOldPermissions");+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.csindex 0da410323..75eab705c 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.cs@@ -1,51 +1,57 @@using Grand.Business.Core.Utilities.Common.Security;using Grand.Data;+using Grand.Domain.Admin;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._2._1+namespace Grand.Business.System.Services.Migrations._2._1;++public class MigrationUpdateAdminSiteMap : IMigration{- public class MigrationUpdateAdminSiteMap : IMigration- {+ public int Priority => 0;+ public DbVersion Version => new(2, 1);+ public Guid Identity => new("8E1C04EB-4A76-4C6F-91E2-4C873EDA9C14");+ public string Name => "Update standard admin site map - remove unused";- public int Priority => 0;- public DbVersion Version => new(2, 1);- public Guid Identity => new("8E1C04EB-4A76-4C6F-91E2-4C873EDA9C14");- public string Name => "Update standard admin site map - remove unused";+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<AdminSiteMap>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateAdminSiteMap>>();- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Domain.Admin.AdminSiteMap>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateAdminSiteMap>>();-- try+ var sitemapSystem = repository.Table.FirstOrDefault(x => x.SystemName == "Marketing");+ if (sitemapSystem != null){- var sitemapSystem = repository.Table.FirstOrDefault(x => x.SystemName == "Marketing");- if (sitemapSystem != null)- {- sitemapSystem.PermissionNames = new List<string> { PermissionSystemName.Affiliates, PermissionSystemName.NewsletterCategories, PermissionSystemName.NewsletterSubscribers,- PermissionSystemName.Campaigns, PermissionSystemName.Discounts, PermissionSystemName.PushNotifications,- PermissionSystemName.Affiliates, PermissionSystemName.Documents, PermissionSystemName.GiftVouchers,- PermissionSystemName.ContactAttributes};+ sitemapSystem.PermissionNames = new List<string> {+ PermissionSystemName.Affiliates, PermissionSystemName.NewsletterCategories,+ PermissionSystemName.NewsletterSubscribers,+ PermissionSystemName.Campaigns, PermissionSystemName.Discounts,+ PermissionSystemName.PushNotifications,+ PermissionSystemName.Affiliates, PermissionSystemName.Documents, PermissionSystemName.GiftVouchers,+ PermissionSystemName.ContactAttributes+ };- sitemapSystem.ChildNodes.Remove(sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Customer reminders"));- sitemapSystem.ChildNodes.Remove(sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Customer actions"));+ sitemapSystem.ChildNodes.Remove(+ sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Customer reminders"));+ sitemapSystem.ChildNodes.Remove(+ sitemapSystem.ChildNodes.FirstOrDefault(x => x.SystemName == "Customer actions"));- repository.Update(sitemapSystem);- }+ repository.Update(sitemapSystem);}- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");- }- return true;}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateResourceString.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateResourceString.csindex 306ba7bef..966b55f5a 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateResourceString.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateResourceString.cs@@ -1,24 +1,23 @@using Grand.Data;using Grand.Infrastructure.Migrations;-namespace Grand.Business.System.Services.Migrations._2._1+namespace Grand.Business.System.Services.Migrations._2._1;++public class MigrationUpdateResourceString : IMigration{- public class MigrationUpdateResourceString : IMigration- {- public int Priority => 0;- public DbVersion Version => new(2, 1);- public Guid Identity => new("2803EE48-7875-4AB9-BDFA-3B1FBC7CC37E");- public string Name => "Update resource string for english language 2.1";+ public int Priority => 0;+ public DbVersion Version => new(2, 1);+ public Guid Identity => new("2803EE48-7875-4AB9-BDFA-3B1FBC7CC37E");+ public string Name => "Update resource string for english language 2.1";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_210.xml");- }+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_210.xml");}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpgradeDbVersion_21.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpgradeDbVersion_21.csindex c7dfbb1a8..25928e75f 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpgradeDbVersion_21.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpgradeDbVersion_21.cs@@ -1,37 +1,35 @@-using Grand.Domain.Common;-using Grand.Data;+using Grand.Data;+using Grand.Domain.Common;using Grand.Infrastructure;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Migrations._2._1-{- public class MigrationUpgradeDbVersion_21 : IMigration- {+namespace Grand.Business.System.Services.Migrations._2._1;- public int Priority => 0;+public class MigrationUpgradeDbVersion_21 : IMigration+{+ public int Priority => 0;- public DbVersion Version => new(2, 1);+ public DbVersion Version => new(2, 1);- public Guid Identity => new("EA674DAA-66B2-4F21-9C68-008ACE752FBD");+ public Guid Identity => new("EA674DAA-66B2-4F21-9C68-008ACE752FBD");- public string Name => "Upgrade version of the database to 2.1";+ public string Name => "Upgrade version of the database to 2.1";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();- var dbversion = repository.Table.ToList().FirstOrDefault();- dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";- repository.Update(dbversion);+ var dbversion = repository.Table.ToList().FirstOrDefault();+ dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";+ repository.Update(dbversion);- return true;- }+ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationAddLandingPage.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationAddLandingPage.csindex 0302f3c4d..532198a59 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationAddLandingPage.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationAddLandingPage.cs@@ -5,18 +5,19 @@ using Microsoft.Extensions.DependencyInjection;namespace Grand.Business.System.Services.Migrations._2._2;-public class MigrationAddLandingPage: IMigration+public class MigrationAddLandingPage : IMigration{public int Priority => 0;public DbVersion Version => new(2, 2);public Guid Identity => new("0833f104-54d5-41d0-83da-375d2520f709");public string Name => "Add new landing page - VendorPortalInfo";+public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider){var pageLayoutRepository = serviceProvider.GetRequiredService<IRepository<PageLayout>>();var defaultPageLayout =pageLayoutRepository.Table.FirstOrDefault(tt => tt.Name == "Default layout");-+var repository = serviceProvider.GetRequiredService<IRepository<Page>>();var page = new Page {SystemName = "VendorPortalInfo",diff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationScheduleTasks.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationScheduleTasks.csindex 10e9efa83..f0750f66c 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationScheduleTasks.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationScheduleTasks.cs@@ -4,37 +4,36 @@ using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._2._2+namespace Grand.Business.System.Services.Migrations._2._2;++public class MigrationScheduleTasks : IMigration{- public class MigrationScheduleTasks : IMigration- {- public int Priority => 0;- public DbVersion Version => new(2, 2);- public Guid Identity => new("17E09B6B-A8BB-45B4-B13D-4D76711DCD7A");- public string Name => "Remove ScheduleTask - Clear log";+ public int Priority => 0;+ public DbVersion Version => new(2, 2);+ public Guid Identity => new("17E09B6B-A8BB-45B4-B13D-4D76711DCD7A");+ public string Name => "Remove ScheduleTask - Clear log";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<ScheduleTask>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationScheduleTasks>>();+ try{- var repository = serviceProvider.GetRequiredService<IRepository<ScheduleTask>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationScheduleTasks>>();- try- {- var scheduleTask = repository.Table.FirstOrDefault(x => x.ScheduleTaskName == "Clear log");- if (scheduleTask != null)- repository.Delete(scheduleTask);- }- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - Remove ScheduleTasks");- }-- return true;+ var scheduleTask = repository.Table.FirstOrDefault(x => x.ScheduleTaskName == "Clear log");+ if (scheduleTask != null)+ repository.Delete(scheduleTask);}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - Remove ScheduleTasks");+ }++ return true;}}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.csindex ef79480c0..cb76a3598 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs@@ -1,66 +1,66 @@using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Utilities.Common.Security;-using Grand.Domain.Customers;using Grand.Data;+using Grand.Domain.Customers;using Grand.Domain.Permissions;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._2._2+namespace Grand.Business.System.Services.Migrations._2._2;++public class MigrationSystemPermission : IMigration{- public class MigrationSystemPermission : IMigration+ public int Priority => 0;+ public DbVersion Version => new(2, 2);+ public Guid Identity => new("8F35D0AF-28EF-4734-BC93-9F8A0F63E79A");++ public string Name =>+ "Install new permission - ManageAccessVendorPanel / Delete permission - ManageSystemLog/ManageActivityLog";++ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider){- public int Priority => 0;- public DbVersion Version => new(2, 2);- public Guid Identity => new("8F35D0AF-28EF-4734-BC93-9F8A0F63E79A");- public string Name => "Install new permission - ManageAccessVendorPanel / Delete permission - ManageSystemLog/ManageActivityLog";+ var repository = serviceProvider.GetRequiredService<IRepository<Permission>>();+ var groupService = serviceProvider.GetRequiredService<IGroupService>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationSystemPermission>>();- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Permission>>();- var groupService = serviceProvider.GetRequiredService<IGroupService>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationSystemPermission>>();-- try+ var customerGroupVendorId = groupService.GetCustomerGroupBySystemName(SystemCustomerGroupNames.Vendors)+ .GetAwaiter().GetResult().Id;+ var permissionAccessVendor =+ repository.Table.FirstOrDefault(x => x.SystemName == PermissionSystemName.AccessVendorPanel);+ if (permissionAccessVendor == null){- var customerGroupVendorId = groupService.GetCustomerGroupBySystemName(SystemCustomerGroupNames.Vendors).GetAwaiter().GetResult().Id;- var permissionAccessVendor = repository.Table.FirstOrDefault(x => x.SystemName == PermissionSystemName.AccessVendorPanel);- if (permissionAccessVendor == null)- {- permissionAccessVendor = StandardPermission.ManageAccessVendorPanel;- permissionAccessVendor.CustomerGroups.Add(customerGroupVendorId);- repository.Insert(permissionAccessVendor);- }- var permissionAccessAdmin = repository.Table.FirstOrDefault(x => x.SystemName == PermissionSystemName.AccessAdminPanel);- if (permissionAccessAdmin != null)- {- permissionAccessAdmin.CustomerGroups.Remove(customerGroupVendorId);- repository.Update(permissionAccessAdmin);- }- var permissionManageSystemLog = repository.Table.FirstOrDefault(x => x.SystemName == "ManageSystemLog");- if (permissionManageSystemLog != null)- {- repository.Delete(permissionManageSystemLog);- }- var permissionManageActivityLog = repository.Table.FirstOrDefault(x => x.SystemName == "ManageActivityLog");- if (permissionManageActivityLog != null)- {- repository.Delete(permissionManageActivityLog);- }-+ permissionAccessVendor = StandardPermission.ManageAccessVendorPanel;+ permissionAccessVendor.CustomerGroups.Add(customerGroupVendorId);+ repository.Insert(permissionAccessVendor);}- catch (Exception ex)++ var permissionAccessAdmin =+ repository.Table.FirstOrDefault(x => x.SystemName == PermissionSystemName.AccessAdminPanel);+ if (permissionAccessAdmin != null){- logService.LogError(ex, "UpgradeProcess - add new permission");+ permissionAccessAdmin.CustomerGroups.Remove(customerGroupVendorId);+ repository.Update(permissionAccessAdmin);}- return true;++ var permissionManageSystemLog = repository.Table.FirstOrDefault(x => x.SystemName == "ManageSystemLog");+ if (permissionManageSystemLog != null) repository.Delete(permissionManageSystemLog);+ var permissionManageActivityLog = repository.Table.FirstOrDefault(x => x.SystemName == "ManageActivityLog");+ if (permissionManageActivityLog != null) repository.Delete(permissionManageActivityLog);}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - add new permission");+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.csindex 7e70752ef..2240ea3ff 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs@@ -1,94 +1,90 @@using Grand.Business.Core.Utilities.Common.Security;-using Grand.Domain.Admin;using Grand.Data;+using Grand.Domain.Admin;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations._2._2+namespace Grand.Business.System.Services.Migrations._2._2;++public class MigrationUpdateAdminSiteMap : IMigration{- public class MigrationUpdateAdminSiteMap : IMigration+ public int Priority => 0;+ public DbVersion Version => new(2, 2);+ public Guid Identity => new("D548BACF-3DF8-48ED-A522-086EAB165808");+ public string Name => "Update standard admin site map - add admin menu";++ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider){- public int Priority => 0;- public DbVersion Version => new(2, 2);- public Guid Identity => new("D548BACF-3DF8-48ED-A522-086EAB165808");- public string Name => "Update standard admin site map - add admin menu";+ var repository = serviceProvider.GetRequiredService<IRepository<AdminSiteMap>>();+ var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateAdminSiteMap>>();- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ try{- var repository = serviceProvider.GetRequiredService<IRepository<Domain.Admin.AdminSiteMap>>();- var logService = serviceProvider.GetRequiredService<ILogger<MigrationUpdateAdminSiteMap>>();-- try+ var sitemapConfiguration = repository.Table.FirstOrDefault(x => x.SystemName == "Configuration");+ if (sitemapConfiguration != null){- var sitemapConfiguration = repository.Table.FirstOrDefault(x => x.SystemName == "Configuration");- if (sitemapConfiguration != null)- {- if (sitemapConfiguration.ChildNodes.FirstOrDefault(x => x.SystemName == "Admin menu") == null)- {- sitemapConfiguration.ChildNodes.Add(new AdminSiteMap {- SystemName = "Admin menu",- ResourceName = "Admin.Configuration.Menu",- PermissionNames = new List<string> { PermissionSystemName.Maintenance },- ControllerName = "Menu",- ActionName = "Index",- DisplayOrder = 7,- IconClass = "fa fa-dot-circle-o"- });- }- sitemapConfiguration.PermissionNames.Remove("ManageActivityLog");- repository.Update(sitemapConfiguration);- }+ if (sitemapConfiguration.ChildNodes.FirstOrDefault(x => x.SystemName == "Admin menu") == null)+ sitemapConfiguration.ChildNodes.Add(new AdminSiteMap {+ SystemName = "Admin menu",+ ResourceName = "Admin.Configuration.Menu",+ PermissionNames = new List<string> { PermissionSystemName.Maintenance },+ ControllerName = "Menu",+ ActionName = "Index",+ DisplayOrder = 7,+ IconClass = "fa fa-dot-circle-o"+ });+ sitemapConfiguration.PermissionNames.Remove("ManageActivityLog");+ repository.Update(sitemapConfiguration);+ }- var sitemapSystem = repository.Table.FirstOrDefault(x => x.SystemName == "System");- var log = sitemapSystem?.ChildNodes.FirstOrDefault(x => x.SystemName == "Log");- if (log != null)- {- sitemapSystem.ChildNodes.Remove(log);- sitemapSystem.PermissionNames.Remove("ManageSystemLog");- repository.Update(sitemapSystem);- }-- var sitemapCustomers = repository.Table.FirstOrDefault(x => x.SystemName == "Customers");- var activityLog = sitemapCustomers?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Log");- if (activityLog != null)- {- sitemapCustomers.ChildNodes.Remove(activityLog);- sitemapCustomers.PermissionNames.Remove("ManageActivityLog");- repository.Update(sitemapCustomers);- }-- var sitemapReports = repository.Table.FirstOrDefault(x => x.SystemName == "Reports");- var activityStatLog = sitemapReports?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Stats");- if (activityStatLog != null)- {- sitemapReports.ChildNodes.Remove(activityStatLog);- sitemapReports.PermissionNames.Remove("ManageActivityLog");- repository.Update(sitemapReports);- }-- var sitemapSettings = repository.Table.FirstOrDefault(x => x.SystemName == "Settings");- var activityTypes = sitemapSettings?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Types");- if (activityTypes != null)- {- sitemapSettings.ChildNodes.Remove(activityTypes);- sitemapSettings.PermissionNames.Remove("ManageActivityLog");- repository.Update(sitemapSettings);- }+ var sitemapSystem = repository.Table.FirstOrDefault(x => x.SystemName == "System");+ var log = sitemapSystem?.ChildNodes.FirstOrDefault(x => x.SystemName == "Log");+ if (log != null)+ {+ sitemapSystem.ChildNodes.Remove(log);+ sitemapSystem.PermissionNames.Remove("ManageSystemLog");+ repository.Update(sitemapSystem);+ }+ var sitemapCustomers = repository.Table.FirstOrDefault(x => x.SystemName == "Customers");+ var activityLog = sitemapCustomers?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Log");+ if (activityLog != null)+ {+ sitemapCustomers.ChildNodes.Remove(activityLog);+ sitemapCustomers.PermissionNames.Remove("ManageActivityLog");+ repository.Update(sitemapCustomers);}- catch (Exception ex)++ var sitemapReports = repository.Table.FirstOrDefault(x => x.SystemName == "Reports");+ var activityStatLog = sitemapReports?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Stats");+ if (activityStatLog != null){- logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");+ sitemapReports.ChildNodes.Remove(activityStatLog);+ sitemapReports.PermissionNames.Remove("ManageActivityLog");+ repository.Update(sitemapReports);}- return true;+ var sitemapSettings = repository.Table.FirstOrDefault(x => x.SystemName == "Settings");+ var activityTypes = sitemapSettings?.ChildNodes.FirstOrDefault(x => x.SystemName == "Activity Types");+ if (activityTypes != null)+ {+ sitemapSettings.ChildNodes.Remove(activityTypes);+ sitemapSettings.PermissionNames.Remove("ManageActivityLog");+ repository.Update(sitemapSettings);+ }}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - UpdateAdminSiteMap");+ }++ return true;}}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateResourceString.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateResourceString.csindex 560ea45f6..dfcde1d6a 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateResourceString.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateResourceString.cs@@ -1,24 +1,23 @@using Grand.Data;using Grand.Infrastructure.Migrations;-namespace Grand.Business.System.Services.Migrations._2._2+namespace Grand.Business.System.Services.Migrations._2._2;++public class MigrationUpdateResourceString : IMigration{- public class MigrationUpdateResourceString : IMigration- {- public int Priority => 0;- public DbVersion Version => new(2, 2);- public Guid Identity => new("97287FAC-ECF6-462E-9ED0-586C26151A4F");- public string Name => "Update resource string for english language 2.2";+ public int Priority => 0;+ public DbVersion Version => new(2, 2);+ public Guid Identity => new("97287FAC-ECF6-462E-9ED0-586C26151A4F");+ public string Name => "Update resource string for english language 2.2";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_220.xml");- }+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ return serviceProvider.ImportLanguageResourcesFromXml("App_Data/Resources/Upgrade/en_220.xml");}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpgradeDbVersion_22.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpgradeDbVersion_22.csindex 3825f2551..9e96d8cf4 100644--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpgradeDbVersion_22.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpgradeDbVersion_22.cs@@ -1,37 +1,35 @@-using Grand.Domain.Common;-using Grand.Data;+using Grand.Data;+using Grand.Domain.Common;using Grand.Infrastructure;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Services.Migrations._2._2-{- public class MigrationUpgradeDbVersion_22 : IMigration- {+namespace Grand.Business.System.Services.Migrations._2._2;- public int Priority => 0;+public class MigrationUpgradeDbVersion_22 : IMigration+{+ public int Priority => 0;- public DbVersion Version => new(2, 2);+ public DbVersion Version => new(2, 2);- public Guid Identity => new("9B9FD138-7E67-44AA-913B-273F3D5B5DE9");+ public Guid Identity => new("9B9FD138-7E67-44AA-913B-273F3D5B5DE9");- public string Name => "Upgrade version of the database to 2.2";+ public string Name => "Upgrade version of the database to 2.2";- /// <summary>- /// Upgrade process- /// </summary>- /// <param name="database"></param>- /// <param name="serviceProvider"></param>- /// <returns></returns>- public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)- {- var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();+ /// <summary>+ /// Upgrade process+ /// </summary>+ /// <param name="database"></param>+ /// <param name="serviceProvider"></param>+ /// <returns></returns>+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)+ {+ var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();- var dbversion = repository.Table.ToList().FirstOrDefault();- dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";- repository.Update(dbversion);+ var dbversion = repository.Table.ToList().FirstOrDefault();+ dbversion.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";+ repository.Update(dbversion);- return true;- }+ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/MigrationProcess.cs b/src/Business/Grand.Business.System/Services/Migrations/MigrationProcess.csindex cb38213e9..fbde9ddfb 100644--- a/src/Business/Grand.Business.System/Services/Migrations/MigrationProcess.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/MigrationProcess.cs@@ -3,96 +3,92 @@ using Grand.Domain;using Grand.Infrastructure.Migrations;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations+namespace Grand.Business.System.Services.Migrations;++public class MigrationProcess : IMigrationProcess{- public class MigrationProcess : IMigrationProcess- {- private readonly IDatabaseContext _databaseContext;- private readonly IServiceProvider _serviceProvider;- private readonly ILogger<MigrationProcess> _logger;+ private readonly IDatabaseContext _databaseContext;+ private readonly ILogger<MigrationProcess> _logger;- private readonly IRepository<MigrationDb> _repositoryMigration;+ private readonly IRepository<MigrationDb> _repositoryMigration;+ private readonly IServiceProvider _serviceProvider;- public MigrationProcess(- IDatabaseContext databaseContext,- IServiceProvider serviceProvider,- ILogger<MigrationProcess> logger,- IRepository<MigrationDb> repositoryMigration)- {- _databaseContext = databaseContext;- _serviceProvider = serviceProvider;- _logger = logger;- _repositoryMigration = repositoryMigration;- }+ public MigrationProcess(+ IDatabaseContext databaseContext,+ IServiceProvider serviceProvider,+ ILogger<MigrationProcess> logger,+ IRepository<MigrationDb> repositoryMigration)+ {+ _databaseContext = databaseContext;+ _serviceProvider = serviceProvider;+ _logger = logger;+ _repositoryMigration = repositoryMigration;+ }- public virtual MigrationResult RunProcess(IMigration migration)+ public virtual MigrationResult RunProcess(IMigration migration)+ {+ var result = RunProcessInternal(migration);+ try{- var result = RunProcessInternal(migration);- try+ if (result.Success){- if (result.Success)- {- SaveMigration(result);- _logger.LogInformation($"The migration of {migration.Name} ({migration.Version}) has been completed successfully.");- }- else- _logger.LogError("Something went wrong during migration process {MigrationName}", migration.Name);- return result;+ SaveMigration(result);+ _logger.LogInformation(+ $"The migration of {migration.Name} ({migration.Version}) has been completed successfully.");}- catch (Exception ex)+ else{- throw new InvalidOperationException($"Exception run migration {migration.Name}", ex);+ _logger.LogError("Something went wrong during migration process {MigrationName}", migration.Name);}- }- private MigrationResult RunProcessInternal(IMigration migration)- {- var model = new MigrationResult {- Success = migration.UpgradeProcess(_databaseContext, _serviceProvider),- Migration = migration- };- return model;+ return result;}-- private void SaveMigration(MigrationResult migrationResult, bool install = false)+ catch (Exception ex){- _repositoryMigration.Insert(new MigrationDb {- Identity = migrationResult.Migration.Identity,- Name = migrationResult.Migration.Name,- Version = migrationResult.Migration.Version.ToString(),- InstallApp = install- });+ throw new InvalidOperationException($"Exception run migration {migration.Name}", ex);}+ }- private IList<MigrationDb> GetMigrationDb()- {- return _repositoryMigration.Table.ToList();- }+ public virtual void RunMigrationProcess()+ {+ var migrationsDb = GetMigrationDb();+ var migrationManager = new MigrationManager();+ foreach (var item in migrationManager.GetCurrentMigrations())+ if (migrationsDb.FirstOrDefault(x => x.Identity == item.Identity) == null)+ RunProcess(item);+ }- public virtual void RunMigrationProcess()- {- var migrationsDb = GetMigrationDb();- var migrationManager = new MigrationManager();- foreach (var item in migrationManager.GetCurrentMigrations())- {- if (migrationsDb.FirstOrDefault(x => x.Identity == item.Identity) == null)- {- RunProcess(item);- }- }- }+ public virtual void InstallApplication()+ {+ var migrationManager = new MigrationManager();+ foreach (var item in migrationManager.GetCurrentMigrations())+ SaveMigration(new MigrationResult {+ Migration = item,+ Success = true+ }, true);+ }- public virtual void InstallApplication()- {- var migrationManager = new MigrationManager();- foreach (var item in migrationManager.GetCurrentMigrations())- {- SaveMigration(new MigrationResult {- Migration = item,- Success = true- }, true);- }- }+ private MigrationResult RunProcessInternal(IMigration migration)+ {+ var model = new MigrationResult {+ Success = migration.UpgradeProcess(_databaseContext, _serviceProvider),+ Migration = migration+ };+ return model;+ }+ private void SaveMigration(MigrationResult migrationResult, bool install = false)+ {+ _repositoryMigration.Insert(new MigrationDb {+ Identity = migrationResult.Migration.Identity,+ Name = migrationResult.Migration.Name,+ Version = migrationResult.Migration.Version.ToString(),+ InstallApp = install+ });+ }++ private IList<MigrationDb> GetMigrationDb()+ {+ return _repositoryMigration.Table.ToList();}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Migrations/MigrationUpdateResource.cs b/src/Business/Grand.Business.System/Services/Migrations/MigrationUpdateResource.csindex 45fe74f70..8c6e337fe 100644--- a/src/Business/Grand.Business.System/Services/Migrations/MigrationUpdateResource.cs+++ b/src/Business/Grand.Business.System/Services/Migrations/MigrationUpdateResource.cs@@ -5,30 +5,32 @@ using Grand.SharedKernel.Extensions;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;-namespace Grand.Business.System.Services.Migrations+namespace Grand.Business.System.Services.Migrations;++public static class MigrationUpdateResource{- public static class MigrationUpdateResource+ public static bool ImportLanguageResourcesFromXml(this IServiceProvider serviceProvider,+ string filename){- public static bool ImportLanguageResourcesFromXml(this IServiceProvider serviceProvider,- string filename)- {- var langRepository = serviceProvider.GetRequiredService<IRepository<Language>>();- var logService = serviceProvider.GetRequiredService<ILoggerFactory>().CreateLogger("ImportLanguageResourcesFromXml");- var translationService = serviceProvider.GetRequiredService<ITranslationService>();+ var langRepository = serviceProvider.GetRequiredService<IRepository<Language>>();+ var logService = serviceProvider.GetRequiredService<ILoggerFactory>()+ .CreateLogger("ImportLanguageResourcesFromXml");+ var translationService = serviceProvider.GetRequiredService<ITranslationService>();- try- {- var language = langRepository.Table.FirstOrDefault(l => l.Name == "English") ?? langRepository.Table.FirstOrDefault();+ try+ {+ var language = langRepository.Table.FirstOrDefault(l => l.Name == "English") ??+ langRepository.Table.FirstOrDefault();- var filePath = CommonPath.MapPath(filename);- var localesXml = File.ReadAllText(filePath);- translationService.ImportResourcesFromXmlInstall(language, localesXml).GetAwaiter().GetResult();- }- catch (Exception ex)- {- logService.LogError(ex, "UpgradeProcess - ImportLanguageResourcesFromXml {Filename}", filename);- }- return true;+ var filePath = CommonPath.MapPath(filename);+ var localesXml = File.ReadAllText(filePath);+ translationService.ImportResourcesFromXmlInstall(language, localesXml).GetAwaiter().GetResult();}+ catch (Exception ex)+ {+ logService.LogError(ex, "UpgradeProcess - ImportLanguageResourcesFromXml {Filename}", filename);+ }++ return true;}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Reports/CustomerReportService.cs b/src/Business/Grand.Business.System/Services/Reports/CustomerReportService.csindex 9ba176fdd..29434d34b 100644--- a/src/Business/Grand.Business.System/Services/Reports/CustomerReportService.cs+++ b/src/Business/Grand.Business.System/Services/Reports/CustomerReportService.cs@@ -1,252 +1,250 @@using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.System.Reports;using Grand.Business.Core.Utilities.System;+using Grand.Data;using Grand.Domain;using Grand.Domain.Customers;-using Grand.Data;using Grand.Domain.Orders;using Grand.Domain.Payments;using Grand.Domain.Shipping;-namespace Grand.Business.System.Services.Reports+namespace Grand.Business.System.Services.Reports;++/// <summary>+/// Customer report service+/// </summary>+public class CustomerReportService : ICustomerReportService{+ #region Ctor+/// <summary>- /// Customer report service+ /// Ctor/// </summary>- public class CustomerReportService : ICustomerReportService+ /// <param name="customerRepository">Customer repository</param>+ /// <param name="orderRepository">Order repository</param>+ /// <param name="dateTimeService">Date time helper</param>+ /// <param name="groupService">group service</param>+ public CustomerReportService(IRepository<Customer> customerRepository,+ IRepository<Order> orderRepository,+ IGroupService groupService,+ IDateTimeService dateTimeService){- #region Fields-- private readonly IRepository<Customer> _customerRepository;- private readonly IRepository<Order> _orderRepository;- private readonly IGroupService _groupService;- private readonly IDateTimeService _dateTimeService;-- #endregion-- #region Ctor-- /// <summary>- /// Ctor- /// </summary>- /// <param name="customerRepository">Customer repository</param>- /// <param name="orderRepository">Order repository</param>- /// <param name="dateTimeService">Date time helper</param>- /// <param name="groupService">group service</param>- public CustomerReportService(IRepository<Customer> customerRepository,- IRepository<Order> orderRepository,- IGroupService groupService,- IDateTimeService dateTimeService)- {- _customerRepository = customerRepository;- _orderRepository = orderRepository;- _groupService = groupService;- _dateTimeService = dateTimeService;- }+ _customerRepository = customerRepository;+ _orderRepository = orderRepository;+ _groupService = groupService;+ _dateTimeService = dateTimeService;+ }- #endregion-- #region Methods-- /// <summary>- /// Get best customers- /// </summary>- /// <param name="storeId">Store ident</param>- /// <param name="vendorId">Vendor ident</param>- /// <param name="createdFromUtc">Order created date from (UTC); null to load all records</param>- /// <param name="createdToUtc">Order created date to (UTC); null to load all records</param>- /// <param name="os">Order status; null to load all records</param>- /// <param name="ps">Order payment status; null to load all records</param>- /// <param name="ss">Order shipment status; null to load all records</param>- /// <param name="orderBy">1 - order by order total, 2 - order by number of orders</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <returns>Report</returns>- public virtual IPagedList<BestCustomerReportLine> GetBestCustomersReport(string storeId = "", string vendorId = "", DateTime? createdFromUtc = null,- DateTime? createdToUtc = null, int? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null, int orderBy = 0,- int pageIndex = 0, int pageSize = 214748364)- {+ #endregion- var query = from p in _orderRepository.Table- select p;-- query = query.Where(o => !o.Deleted);- if (os.HasValue)- query = query.Where(o => o.OrderStatusId == os.Value);- if (ps.HasValue)- query = query.Where(o => o.PaymentStatusId == ps.Value);- if (ss.HasValue)- query = query.Where(o => o.ShippingStatusId == ss.Value);- if (createdFromUtc.HasValue)- query = query.Where(o => createdFromUtc.Value <= o.CreatedOnUtc);- if (createdToUtc.HasValue)- query = query.Where(o => createdToUtc.Value >= o.CreatedOnUtc);- if (!string.IsNullOrEmpty(storeId))- query = query.Where(o => o.StoreId == storeId);-- if (string.IsNullOrEmpty(vendorId))- {- var query2 = from co in query- group co by co.CustomerId into g- select new- {- CustomerId = g.Key,- OrderTotal = g.Sum(x => x.OrderTotal / x.CurrencyRate),- OrderCount = g.Count()- };- query2 = orderBy switch {- 1 => query2.OrderByDescending(x => x.OrderTotal),- 2 => query2.OrderByDescending(x => x.OrderCount),- _ => throw new ArgumentException("Wrong orderBy parameter", nameof(orderBy))- };+ #region Fields++ private readonly IRepository<Customer> _customerRepository;+ private readonly IRepository<Order> _orderRepository;+ private readonly IGroupService _groupService;+ private readonly IDateTimeService _dateTimeService;- var tmp = new PagedList<dynamic>(query2, pageIndex, pageSize);- return new PagedList<BestCustomerReportLine>(tmp.Select(x => new BestCustomerReportLine {- CustomerId = x.CustomerId,- OrderTotal = x.OrderTotal,- OrderCount = x.OrderCount- }), tmp.PageIndex, tmp.PageSize, tmp.TotalCount);- }-- var vendorQuery = from p in query- from item in p.OrderItems+ #endregion++ #region Methods++ /// <summary>+ /// Get best customers+ /// </summary>+ /// <param name="storeId">Store ident</param>+ /// <param name="vendorId">Vendor ident</param>+ /// <param name="createdFromUtc">Order created date from (UTC); null to load all records</param>+ /// <param name="createdToUtc">Order created date to (UTC); null to load all records</param>+ /// <param name="os">Order status; null to load all records</param>+ /// <param name="ps">Order payment status; null to load all records</param>+ /// <param name="ss">Order shipment status; null to load all records</param>+ /// <param name="orderBy">1 - order by order total, 2 - order by number of orders</param>+ /// <param name="pageIndex">Page index</param>+ /// <param name="pageSize">Page size</param>+ /// <returns>Report</returns>+ public virtual IPagedList<BestCustomerReportLine> GetBestCustomersReport(string storeId = "", string vendorId = "",+ DateTime? createdFromUtc = null,+ DateTime? createdToUtc = null, int? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null,+ int orderBy = 0,+ int pageIndex = 0, int pageSize = 214748364)+ {+ var query = from p in _orderRepository.Table+ select p;++ query = query.Where(o => !o.Deleted);+ if (os.HasValue)+ query = query.Where(o => o.OrderStatusId == os.Value);+ if (ps.HasValue)+ query = query.Where(o => o.PaymentStatusId == ps.Value);+ if (ss.HasValue)+ query = query.Where(o => o.ShippingStatusId == ss.Value);+ if (createdFromUtc.HasValue)+ query = query.Where(o => createdFromUtc.Value <= o.CreatedOnUtc);+ if (createdToUtc.HasValue)+ query = query.Where(o => createdToUtc.Value >= o.CreatedOnUtc);+ if (!string.IsNullOrEmpty(storeId))+ query = query.Where(o => o.StoreId == storeId);++ if (string.IsNullOrEmpty(vendorId))+ {+ var query2 = from co in query+ group co by co.CustomerId+ into gselect new {- item.VendorId,- p.CustomerId, OrderCode = p.Code,- item.Quantity,- item.PriceInclTax,- p.Rate };-- vendorQuery = vendorQuery.Where(x => x.VendorId == vendorId);-- var vendorQueryGroup = from co in vendorQuery- group co by co.CustomerId into g- select new- {CustomerId = g.Key,- OrderTotal = g.Sum(x => x.PriceInclTax / x.Rate),+ OrderTotal = g.Sum(x => x.OrderTotal / x.CurrencyRate),OrderCount = g.Count()};- vendorQueryGroup = orderBy switch {- 1 => vendorQueryGroup.OrderByDescending(x => x.OrderTotal),- 2 => vendorQueryGroup.OrderByDescending(x => x.OrderCount),+ query2 = orderBy switch {+ 1 => query2.OrderByDescending(x => x.OrderTotal),+ 2 => query2.OrderByDescending(x => x.OrderCount),_ => throw new ArgumentException("Wrong orderBy parameter", nameof(orderBy))};- var vendorReport = new PagedList<dynamic>(vendorQueryGroup, pageIndex, pageSize);- return new PagedList<BestCustomerReportLine>(vendorReport.Select(x => new BestCustomerReportLine {+ var tmp = new PagedList<dynamic>(query2, pageIndex, pageSize);+ return new PagedList<BestCustomerReportLine>(tmp.Select(x => new BestCustomerReportLine {CustomerId = x.CustomerId,OrderTotal = x.OrderTotal,OrderCount = x.OrderCount- }), vendorReport.PageIndex, vendorReport.PageSize, vendorReport.TotalCount);-+ }), tmp.PageIndex, tmp.PageSize, tmp.TotalCount);}- /// <summary>- /// Gets a report of customers registered in the last days- /// </summary>- /// <param name="storeId">Store ident</param>- /// <param name="days">Customers registered in the last days</param>- /// <returns>Number of registered customers</returns>- public virtual async Task<int> GetRegisteredCustomersReport(string storeId, int days)- {- DateTime date = _dateTimeService.ConvertToUserTime(DateTime.Now).AddDays(-days);-- var registeredCustomerGroup = await _groupService.GetCustomerGroupBySystemName(SystemCustomerGroupNames.Registered);- if (registeredCustomerGroup == null)- return 0;-- var query = from c in _customerRepository.Table- where !c.Deleted &&- (string.IsNullOrEmpty(storeId) || c.StoreId == storeId) &&- c.Groups.Any(cr => cr == registeredCustomerGroup.Id) &&- c.CreatedOnUtc >= date- //&& c.CreatedOnUtc <= DateTime.UtcNow- select c;- var count = query.Count();- return count;- }+ var vendorQuery = from p in query+ from item in p.OrderItems+ select new {+ item.VendorId,+ p.CustomerId, OrderCode = p.Code,+ item.Quantity,+ item.PriceInclTax,+ p.Rate+ };+ vendorQuery = vendorQuery.Where(x => x.VendorId == vendorId);++ var vendorQueryGroup = from co in vendorQuery+ group co by co.CustomerId+ into g+ select new {+ CustomerId = g.Key,+ OrderTotal = g.Sum(x => x.PriceInclTax / x.Rate),+ OrderCount = g.Count()+ };+ vendorQueryGroup = orderBy switch {+ 1 => vendorQueryGroup.OrderByDescending(x => x.OrderTotal),+ 2 => vendorQueryGroup.OrderByDescending(x => x.OrderCount),+ _ => throw new ArgumentException("Wrong orderBy parameter", nameof(orderBy))+ };++ var vendorReport = new PagedList<dynamic>(vendorQueryGroup, pageIndex, pageSize);+ return new PagedList<BestCustomerReportLine>(vendorReport.Select(x => new BestCustomerReportLine {+ CustomerId = x.CustomerId,+ OrderTotal = x.OrderTotal,+ OrderCount = x.OrderCount+ }), vendorReport.PageIndex, vendorReport.PageSize, vendorReport.TotalCount);+ }++ /// <summary>+ /// Gets a report of customers registered in the last days+ /// </summary>+ /// <param name="storeId">Store ident</param>+ /// <param name="days">Customers registered in the last days</param>+ /// <returns>Number of registered customers</returns>+ public virtual async Task<int> GetRegisteredCustomersReport(string storeId, int days)+ {+ var date = _dateTimeService.ConvertToUserTime(DateTime.Now).AddDays(-days);++ var registeredCustomerGroup =+ await _groupService.GetCustomerGroupBySystemName(SystemCustomerGroupNames.Registered);+ if (registeredCustomerGroup == null)+ return 0;++ var query = from c in _customerRepository.Table+ where !c.Deleted &&+ (string.IsNullOrEmpty(storeId) || c.StoreId == storeId) &&+ c.Groups.Any(cr => cr == registeredCustomerGroup.Id) &&+ c.CreatedOnUtc >= date+ //&& c.CreatedOnUtc <= DateTime.UtcNow+ select c;+ var count = query.Count();+ return count;+ }- /// <summary>- /// Get "customer by time" report- /// </summary>- /// <param name="storeId">Store ident</param>- /// <param name="startTimeUtc">Start date</param>- /// <param name="endTimeUtc">End date</param>- /// <returns>Result</returns>- public virtual async Task<IList<CustomerByTimeReportLine>> GetCustomerByTimeReport(string storeId, DateTime? startTimeUtc = null,- DateTime? endTimeUtc = null)+ /// <summary>+ /// Get "customer by time" report+ /// </summary>+ /// <param name="storeId">Store ident</param>+ /// <param name="startTimeUtc">Start date</param>+ /// <param name="endTimeUtc">End date</param>+ /// <returns>Result</returns>+ public virtual async Task<IList<CustomerByTimeReportLine>> GetCustomerByTimeReport(string storeId,+ DateTime? startTimeUtc = null,+ DateTime? endTimeUtc = null)++ {+ var report = new List<CustomerByTimeReportLine>();+ startTimeUtc ??= DateTime.MinValue;+ endTimeUtc ??= DateTime.UtcNow;++ var endTime = new DateTime(endTimeUtc.Value.Year, endTimeUtc.Value.Month, endTimeUtc.Value.Day, 23, 59, 00);+ var builderquery = from p in _customerRepository.Table+ select p;++ var customergroup = await _groupService.GetCustomerGroupBySystemName(SystemCustomerGroupNames.Registered);+ var customerGroupRegister = customergroup.Id;+ builderquery = builderquery.Where(o => !o.Deleted);+ builderquery = builderquery.Where(o => o.CreatedOnUtc >= startTimeUtc.Value && o.CreatedOnUtc <= endTime);+ builderquery = builderquery.Where(o => o.Groups.Any(y => y == customerGroupRegister));+ if (!string.IsNullOrEmpty(storeId))+ builderquery = builderquery.Where(o => o.StoreId == storeId);++ var daydiff = (endTimeUtc.Value - startTimeUtc.Value).TotalDays;+ if (daydiff > 31){- List<CustomerByTimeReportLine> report = new List<CustomerByTimeReportLine>();- startTimeUtc ??= DateTime.MinValue;- endTimeUtc ??= DateTime.UtcNow;-- var endTime = new DateTime(endTimeUtc.Value.Year, endTimeUtc.Value.Month, endTimeUtc.Value.Day, 23, 59, 00);- var builderquery = from p in _customerRepository.Table- select p;-- var customergroup = await _groupService.GetCustomerGroupBySystemName(SystemCustomerGroupNames.Registered);- var customerGroupRegister = customergroup.Id;- builderquery = builderquery.Where(o => !o.Deleted);- builderquery = builderquery.Where(o => o.CreatedOnUtc >= startTimeUtc.Value && o.CreatedOnUtc <= endTime);- builderquery = builderquery.Where(o => o.Groups.Any(y => y == customerGroupRegister));- if (!string.IsNullOrEmpty(storeId))- builderquery = builderquery.Where(o => o.StoreId == storeId);-- var daydiff = (endTimeUtc.Value - startTimeUtc.Value).TotalDays;- if (daydiff > 31)- {- var query = builderquery.GroupBy(x => new- {+ var query = builderquery.GroupBy(x => new {x.CreatedOnUtc.Year,- x.CreatedOnUtc.Month })- .Select(g => new CustomerStats {- Year = g.Key.Year,- Month = g.Key.Month,- Count = g.Count()- }).ToList();- foreach (var item in query)- {- report.Add(new CustomerByTimeReportLine {- Time = item.Year + "-" + item.Month.ToString().PadLeft(2, '0'),- Registered = item.Count- });- }- }- else- {- var query = builderquery.GroupBy(x =>+ x.CreatedOnUtc.Month+ })+ .Select(g => new CustomerStats {+ Year = g.Key.Year,+ Month = g.Key.Month,+ Count = g.Count()+ }).ToList();+ foreach (var item in query)+ report.Add(new CustomerByTimeReportLine {+ Time = item.Year + "-" + item.Month.ToString().PadLeft(2, '0'),+ Registered = item.Count+ });+ }+ else+ {+ var query = builderquery.GroupBy(x =>new { x.CreatedOnUtc.Year, x.CreatedOnUtc.Month, x.CreatedOnUtc.Day })- .Select(g => new CustomerStats {- Year = g.Key.Year,- Month = g.Key.Month,- Day = g.Key.Day,- Count = g.Count()- }).ToList();- foreach (var item in query)- {- report.Add(new CustomerByTimeReportLine {- Time = item.Year + "-" + item.Month.ToString().PadLeft(2, '0') + "-" + item.Day.ToString().PadLeft(2, '0'),- Registered = item.Count- });- }- }---- return report.OrderBy(x => x.Time).ToList();+ .Select(g => new CustomerStats {+ Year = g.Key.Year,+ Month = g.Key.Month,+ Day = g.Key.Day,+ Count = g.Count()+ }).ToList();+ foreach (var item in query)+ report.Add(new CustomerByTimeReportLine {+ Time = item.Year + "-" + item.Month.ToString().PadLeft(2, '0') + "-" ++ item.Day.ToString().PadLeft(2, '0'),+ Registered = item.Count+ });}- #endregion- }- public class CustomerStats- {- public int Year { get; set; }- public int Month { get; set; }- public int Day { get; set; }- public int Count { get; set; }+ return report.OrderBy(x => x.Time).ToList();}++ #endregion+}++public class CustomerStats+{+ public int Year { get; set; }+ public int Month { get; set; }+ public int Day { get; set; }+ public int Count { get; set; }}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs b/src/Business/Grand.Business.System/Services/Reports/OrderReportService.csindex cd06e3a46..9b5fd2d54 100644--- a/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs+++ b/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs@@ -1,131 +1,100 @@using Grand.Business.Core.Interfaces.Common.Directory;using Grand.Business.Core.Interfaces.System.Reports;using Grand.Business.Core.Utilities.System;+using Grand.Data;using Grand.Domain;using Grand.Domain.Catalog;-using Grand.Data;using Grand.Domain.Orders;using Grand.Domain.Payments;using Grand.Domain.Shipping;using System.Globalization;-namespace Grand.Business.System.Services.Reports+namespace Grand.Business.System.Services.Reports;++/// <summary>+/// Order report service+/// </summary>+public class OrderReportService : IOrderReportService{+ #region Ctor+/// <summary>- /// Order report service+ /// Ctor/// </summary>- public class OrderReportService : IOrderReportService+ /// <param name="orderRepository">Order repository</param>+ /// <param name="productAlsoPurchasedRepository">Product also purchased repository</param>+ /// <param name="productRepository">Product repository</param>+ /// <param name="dateTimeService">Datetime helper</param>+ public OrderReportService(IRepository<Order> orderRepository,+ IRepository<ProductAlsoPurchased> productAlsoPurchasedRepository,+ IRepository<Product> productRepository,+ IDateTimeService dateTimeService){- #region Fields-- private readonly IRepository<Order> _orderRepository;- private readonly IRepository<ProductAlsoPurchased> _productAlsoPurchasedRepository;- private readonly IRepository<Product> _productRepository;- private readonly IDateTimeService _dateTimeService;-- #endregion-- #region Ctor-- /// <summary>- /// Ctor- /// </summary>- /// <param name="orderRepository">Order repository</param>- /// <param name="productAlsoPurchasedRepository">Product also purchased repository</param>- /// <param name="productRepository">Product repository</param>- /// <param name="dateTimeService">Datetime helper</param>- public OrderReportService(IRepository<Order> orderRepository,- IRepository<ProductAlsoPurchased> productAlsoPurchasedRepository,- IRepository<Product> productRepository,- IDateTimeService dateTimeService)- {- _orderRepository = orderRepository;- _productAlsoPurchasedRepository = productAlsoPurchasedRepository;- _productRepository = productRepository;- _dateTimeService = dateTimeService;- }+ _orderRepository = orderRepository;+ _productAlsoPurchasedRepository = productAlsoPurchasedRepository;+ _productRepository = productRepository;+ _dateTimeService = dateTimeService;+ }++ #endregion++ #region Fields++ private readonly IRepository<Order> _orderRepository;+ private readonly IRepository<ProductAlsoPurchased> _productAlsoPurchasedRepository;+ private readonly IRepository<Product> _productRepository;+ private readonly IDateTimeService _dateTimeService;++ #endregion++ #region Methods- #endregion-- #region Methods-- /// <summary>- /// Get "order by country" report- /// </summary>- /// <param name="storeId">Store identifier</param>- /// <param name="vendorId">Vendor identifier</param>- /// <param name="os">Order status</param>- /// <param name="ps">Payment status</param>- /// <param name="ss">Shipping status</param>- /// <param name="startTimeUtc">Start date</param>- /// <param name="endTimeUtc">End date</param>- /// <returns>Result</returns>- public virtual async Task<IList<OrderByCountryReportLine>> GetCountryReport(string storeId, string vendorId, int? os,- PaymentStatus? ps, ShippingStatus? ss, DateTime? startTimeUtc, DateTime? endTimeUtc)+ /// <summary>+ /// Get "order by country" report+ /// </summary>+ /// <param name="storeId">Store identifier</param>+ /// <param name="vendorId">Vendor identifier</param>+ /// <param name="os">Order status</param>+ /// <param name="ps">Payment status</param>+ /// <param name="ss">Shipping status</param>+ /// <param name="startTimeUtc">Start date</param>+ /// <param name="endTimeUtc">End date</param>+ /// <returns>Result</returns>+ public virtual async Task<IList<OrderByCountryReportLine>> GetCountryReport(string storeId, string vendorId,+ int? os,+ PaymentStatus? ps, ShippingStatus? ss, DateTime? startTimeUtc, DateTime? endTimeUtc)+ {+ var query = from p in _orderRepository.Table+ select p;++ query = query.Where(o => !o.Deleted);+ if (!string.IsNullOrEmpty(storeId))+ query = query.Where(o => o.StoreId == storeId);+ if (os.HasValue)+ query = query.Where(o => o.OrderStatusId == os.Value);+ if (ps.HasValue)+ query = query.Where(o => o.PaymentStatusId == ps.Value);+ if (ss.HasValue)+ query = query.Where(o => o.ShippingStatusId == ss.Value);+ if (startTimeUtc.HasValue)+ query = query.Where(o => startTimeUtc.Value <= o.CreatedOnUtc);+ if (endTimeUtc.HasValue)+ query = query.Where(o => endTimeUtc.Value >= o.CreatedOnUtc);++ if (!string.IsNullOrEmpty(vendorId))+ query = query+ .Where(o => o.OrderItems+ .Any(orderItem => orderItem.VendorId == vendorId));++ if (string.IsNullOrEmpty(vendorId)){- var query = from p in _orderRepository.Table- select p;-- query = query.Where(o => !o.Deleted);- if (!string.IsNullOrEmpty(storeId))- query = query.Where(o => o.StoreId == storeId);- if (os.HasValue)- query = query.Where(o => o.OrderStatusId == os.Value);- if (ps.HasValue)- query = query.Where(o => o.PaymentStatusId == ps.Value);- if (ss.HasValue)- query = query.Where(o => o.ShippingStatusId == ss.Value);- if (startTimeUtc.HasValue)- query = query.Where(o => startTimeUtc.Value <= o.CreatedOnUtc);- if (endTimeUtc.HasValue)- query = query.Where(o => endTimeUtc.Value >= o.CreatedOnUtc);-- if (!string.IsNullOrEmpty(vendorId))- {- query = query- .Where(o => o.OrderItems- .Any(orderItem => orderItem.VendorId == vendorId));- }-- if (string.IsNullOrEmpty(vendorId))- {- var report = (from oq in query- group oq by oq.BillingAddress.CountryId- into result- select new {- CountryId = result.Key,- TotalOrders = result.Count(),- SumOrders = result.Sum(o => o.OrderTotal / o.CurrencyRate)- }- )- .OrderByDescending(x => x.SumOrders)- .Select(r => new OrderByCountryReportLine {- CountryId = r.CountryId,- TotalOrders = r.TotalOrders,- SumOrders = r.SumOrders- });-- return await Task.FromResult(report.ToList());- }-- var vendorQuery = from p in query- from item in p.OrderItems- select new {- item.VendorId, OrderCode = p.Code,- p.BillingAddress.CountryId,- item.Quantity,- item.PriceInclTax,- p.Rate };-- vendorQuery = vendorQuery.Where(x => x.VendorId == vendorId);-- var vendorReport = (from oq in vendorQuery- group oq by oq.CountryId+ var report = (from oq in query+ group oq by oq.BillingAddress.CountryIdinto resultselect new {CountryId = result.Key,TotalOrders = result.Count(),- SumOrders = result.Sum(y => y.PriceInclTax / y.Rate)+ SumOrders = result.Sum(o => o.OrderTotal / o.CurrencyRate)}).OrderByDescending(x => x.SumOrders)@@ -134,440 +103,474 @@ namespace Grand.Business.System.Services.ReportsTotalOrders = r.TotalOrders,SumOrders = r.SumOrders});- return await Task.FromResult(vendorReport.ToList());-++ return await Task.FromResult(report.ToList());}+ var vendorQuery = from p in query+ from item in p.OrderItems+ select new {+ item.VendorId, OrderCode = p.Code,+ p.BillingAddress.CountryId,+ item.Quantity,+ item.PriceInclTax,+ p.Rate+ };- /// <summary>- /// Get "order by time" report- /// </summary>- /// <param name="storeId">Store identifier; "" to load all records</param>- /// <param name="startTimeUtc">Start date</param>- /// <param name="endTimeUtc">End date</param>- /// <returns>Result</returns>- public virtual async Task<IList<OrderByTimeReportLine>> GetOrderByTimeReport(string storeId, DateTime? startTimeUtc = null,- DateTime? endTimeUtc = null)- {- List<OrderByTimeReportLine> report = new List<OrderByTimeReportLine>();- startTimeUtc ??= DateTime.MinValue;- endTimeUtc ??= DateTime.UtcNow;+ vendorQuery = vendorQuery.Where(x => x.VendorId == vendorId);- var endTime = new DateTime(endTimeUtc.Value.Year, endTimeUtc.Value.Month, endTimeUtc.Value.Day, 23, 59, 00);+ var vendorReport = (from oq in vendorQuery+ group oq by oq.CountryId+ into result+ select new {+ CountryId = result.Key,+ TotalOrders = result.Count(),+ SumOrders = result.Sum(y => y.PriceInclTax / y.Rate)+ }+ )+ .OrderByDescending(x => x.SumOrders)+ .Select(r => new OrderByCountryReportLine {+ CountryId = r.CountryId,+ TotalOrders = r.TotalOrders,+ SumOrders = r.SumOrders+ });+ return await Task.FromResult(vendorReport.ToList());+ }+++ /// <summary>+ /// Get "order by time" report+ /// </summary>+ /// <param name="storeId">Store identifier; "" to load all records</param>+ /// <param name="startTimeUtc">Start date</param>+ /// <param name="endTimeUtc">End date</param>+ /// <returns>Result</returns>+ public virtual async Task<IList<OrderByTimeReportLine>> GetOrderByTimeReport(string storeId,+ DateTime? startTimeUtc = null,+ DateTime? endTimeUtc = null)+ {+ var report = new List<OrderByTimeReportLine>();+ startTimeUtc ??= DateTime.MinValue;+ endTimeUtc ??= DateTime.UtcNow;- var builderquery = from p in _orderRepository.Table- select p;+ var endTime = new DateTime(endTimeUtc.Value.Year, endTimeUtc.Value.Month, endTimeUtc.Value.Day, 23, 59, 00);- builderquery = builderquery.Where(o => !o.Deleted);- builderquery = builderquery.Where(o => o.CreatedOnUtc >= startTimeUtc.Value && o.CreatedOnUtc <= endTime);+ var builderquery = from p in _orderRepository.Table+ select p;- if (!string.IsNullOrEmpty(storeId))- builderquery = builderquery.Where(o => o.StoreId == storeId);+ builderquery = builderquery.Where(o => !o.Deleted);+ builderquery = builderquery.Where(o => o.CreatedOnUtc >= startTimeUtc.Value && o.CreatedOnUtc <= endTime);- var daydiff = (endTimeUtc.Value - startTimeUtc.Value).TotalDays;- if (daydiff > 31)- {- var query = builderquery.GroupBy(x =>+ if (!string.IsNullOrEmpty(storeId))+ builderquery = builderquery.Where(o => o.StoreId == storeId);++ var daydiff = (endTimeUtc.Value - startTimeUtc.Value).TotalDays;+ if (daydiff > 31)+ {+ var query = builderquery.GroupBy(x =>new { x.CreatedOnUtc.Year, x.CreatedOnUtc.Month })- .Select(g => new OrderStats {- Year = g.Key.Year,- Month = g.Key.Month,- Count = g.Count(),- Amount = g.Sum(x => x.OrderTotal * x.CurrencyRate)- }).ToList();-- foreach (var item in query)- {- report.Add(new OrderByTimeReportLine {- Time = item.Year.ToString().PadLeft(2, '0') + "-" + item.Month.ToString().PadLeft(2, '0'),- SumOrders = Math.Round(item.Amount, 2),- TotalOrders = item.Count- });- }- }- else- {- var query = builderquery.GroupBy(x =>+ .Select(g => new OrderStats {+ Year = g.Key.Year,+ Month = g.Key.Month,+ Count = g.Count(),+ Amount = g.Sum(x => x.OrderTotal * x.CurrencyRate)+ }).ToList();++ foreach (var item in query)+ report.Add(new OrderByTimeReportLine {+ Time = item.Year.ToString().PadLeft(2, '0') + "-" + item.Month.ToString().PadLeft(2, '0'),+ SumOrders = Math.Round(item.Amount, 2),+ TotalOrders = item.Count+ });+ }+ else+ {+ var query = builderquery.GroupBy(x =>new { x.CreatedOnUtc.Year, x.CreatedOnUtc.Month, x.CreatedOnUtc.Day })- .Select(g => new OrderStats {- Year = g.Key.Year,- Month = g.Key.Month,- Day = g.Key.Day,- Count = g.Count(),- Amount = g.Sum(x => x.OrderTotal * x.CurrencyRate)- }).ToList();-- foreach (var item in query)- {- report.Add(new OrderByTimeReportLine {- Time = item.Year.ToString().PadLeft(2, '0') + "-" + item.Month.ToString().PadLeft(2, '0') + "-" + item.Day.ToString().PadLeft(2, '0'),- SumOrders = Math.Round(item.Amount, 2),- TotalOrders = item.Count- });- }- }- return await Task.FromResult(report);+ .Select(g => new OrderStats {+ Year = g.Key.Year,+ Month = g.Key.Month,+ Day = g.Key.Day,+ Count = g.Count(),+ Amount = g.Sum(x => x.OrderTotal * x.CurrencyRate)+ }).ToList();++ foreach (var item in query)+ report.Add(new OrderByTimeReportLine {+ Time = item.Year.ToString().PadLeft(2, '0') + "-" + item.Month.ToString().PadLeft(2, '0') + "-" ++ item.Day.ToString().PadLeft(2, '0'),+ SumOrders = Math.Round(item.Amount, 2),+ TotalOrders = item.Count+ });}- /// <summary>- /// Get order average report- /// </summary>- /// <param name="storeId">Store identifier</param>- /// <param name="customerId">Customer identifier</param>- /// <param name="vendorId">Vendor identifier</param>- /// <param name="salesEmployeeId">Sales employee identifier</param>- /// <param name="billingCountryId">Billing country identifier</param>- /// <param name="orderId">Order identifier</param>- /// <param name="paymentMethodSystemName">Payment method system name; null to load all records</param>- /// <param name="os">Order status</param>- /// <param name="ps">Payment status</param>- /// <param name="ss">Shipping status</param>- /// <param name="startTimeUtc">Start date</param>- /// <param name="endTimeUtc">End date</param>- /// <param name="billingEmail">Billing email. Leave empty to load all records.</param>- /// <param name="billingLastName"></param>- /// <param name="ignoreCancelledOrders">A value indicating whether to ignore cancelled orders</param>- /// <param name="tagId">Tag ident.</param>- /// <returns>Result</returns>- public virtual async Task<OrderAverageReportLine> GetOrderAverageReportLine(string storeId = "", string customerId = "",- string vendorId = "", string salesEmployeeId = "", string billingCountryId = "",- string orderId = "", string paymentMethodSystemName = null,- int? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null,- DateTime? startTimeUtc = null, DateTime? endTimeUtc = null,- string billingEmail = null, string billingLastName = "", bool ignoreCancelledOrders = false,- string tagId = null)- {- var builderquery = from p in _orderRepository.Table- select p;+ return await Task.FromResult(report);+ }- builderquery = builderquery.Where(o => !o.Deleted);- if (!string.IsNullOrEmpty(storeId))- builderquery = builderquery.Where(o => o.StoreId == storeId);+ /// <summary>+ /// Get order average report+ /// </summary>+ /// <param name="storeId">Store identifier</param>+ /// <param name="customerId">Customer identifier</param>+ /// <param name="vendorId">Vendor identifier</param>+ /// <param name="salesEmployeeId">Sales employee identifier</param>+ /// <param name="billingCountryId">Billing country identifier</param>+ /// <param name="orderId">Order identifier</param>+ /// <param name="paymentMethodSystemName">Payment method system name; null to load all records</param>+ /// <param name="os">Order status</param>+ /// <param name="ps">Payment status</param>+ /// <param name="ss">Shipping status</param>+ /// <param name="startTimeUtc">Start date</param>+ /// <param name="endTimeUtc">End date</param>+ /// <param name="billingEmail">Billing email. Leave empty to load all records.</param>+ /// <param name="billingLastName"></param>+ /// <param name="ignoreCancelledOrders">A value indicating whether to ignore cancelled orders</param>+ /// <param name="tagId">Tag ident.</param>+ /// <returns>Result</returns>+ public virtual async Task<OrderAverageReportLine> GetOrderAverageReportLine(string storeId = "",+ string customerId = "",+ string vendorId = "", string salesEmployeeId = "", string billingCountryId = "",+ string orderId = "", string paymentMethodSystemName = null,+ int? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null,+ DateTime? startTimeUtc = null, DateTime? endTimeUtc = null,+ string billingEmail = null, string billingLastName = "", bool ignoreCancelledOrders = false,+ string tagId = null)+ {+ var builderquery = from p in _orderRepository.Table+ select p;++ builderquery = builderquery.Where(o => !o.Deleted);+ if (!string.IsNullOrEmpty(storeId))+ builderquery = builderquery.Where(o => o.StoreId == storeId);- if (!string.IsNullOrEmpty(orderId))- builderquery = builderquery.Where(o => o.Id == orderId);+ if (!string.IsNullOrEmpty(orderId))+ builderquery = builderquery.Where(o => o.Id == orderId);- if (!string.IsNullOrEmpty(customerId))- builderquery = builderquery.Where(o => o.CustomerId == customerId);+ if (!string.IsNullOrEmpty(customerId))+ builderquery = builderquery.Where(o => o.CustomerId == customerId);- if (!string.IsNullOrEmpty(vendorId))- {- builderquery = builderquery- .Where(o => o.OrderItems+ if (!string.IsNullOrEmpty(vendorId))+ builderquery = builderquery+ .Where(o => o.OrderItems.Any(orderItem => orderItem.VendorId == vendorId));- }- if (!string.IsNullOrEmpty(salesEmployeeId))- builderquery = builderquery.Where(o => o.SeId == salesEmployeeId);+ if (!string.IsNullOrEmpty(salesEmployeeId))+ builderquery = builderquery.Where(o => o.SeId == salesEmployeeId);- if (!string.IsNullOrEmpty(billingCountryId))- builderquery = builderquery.Where(o => o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId);+ if (!string.IsNullOrEmpty(billingCountryId))+ builderquery = builderquery.Where(o =>+ o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId);- if (ignoreCancelledOrders)- {- builderquery = builderquery.Where(o => o.OrderStatusId != (int)OrderStatusSystem.Cancelled);- }- if (!string.IsNullOrEmpty(paymentMethodSystemName))- builderquery = builderquery.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName);+ if (ignoreCancelledOrders)+ builderquery = builderquery.Where(o => o.OrderStatusId != (int)OrderStatusSystem.Cancelled);+ if (!string.IsNullOrEmpty(paymentMethodSystemName))+ builderquery = builderquery.Where(o => o.PaymentMethodSystemName == paymentMethodSystemName);- if (os.HasValue)- builderquery = builderquery.Where(o => o.OrderStatusId == os.Value);+ if (os.HasValue)+ builderquery = builderquery.Where(o => o.OrderStatusId == os.Value);- if (ps.HasValue)- builderquery = builderquery.Where(o => o.PaymentStatusId == ps.Value);+ if (ps.HasValue)+ builderquery = builderquery.Where(o => o.PaymentStatusId == ps.Value);- if (ss.HasValue)- builderquery = builderquery.Where(o => o.ShippingStatusId == ss.Value);+ if (ss.HasValue)+ builderquery = builderquery.Where(o => o.ShippingStatusId == ss.Value);- if (startTimeUtc.HasValue)- builderquery = builderquery.Where(o => startTimeUtc.Value <= o.CreatedOnUtc);+ if (startTimeUtc.HasValue)+ builderquery = builderquery.Where(o => startTimeUtc.Value <= o.CreatedOnUtc);- if (endTimeUtc.HasValue)- builderquery = builderquery.Where(o => endTimeUtc.Value >= o.CreatedOnUtc);+ if (endTimeUtc.HasValue)+ builderquery = builderquery.Where(o => endTimeUtc.Value >= o.CreatedOnUtc);- if (!string.IsNullOrEmpty(billingEmail))- builderquery = builderquery.Where(o => o.BillingAddress != null && !string.IsNullOrEmpty(o.BillingAddress.Email) && o.BillingAddress.Email.Contains(billingEmail));+ if (!string.IsNullOrEmpty(billingEmail))+ builderquery = builderquery.Where(o =>+ o.BillingAddress != null && !string.IsNullOrEmpty(o.BillingAddress.Email) &&+ o.BillingAddress.Email.Contains(billingEmail));- if (!string.IsNullOrEmpty(billingLastName))- builderquery = builderquery.Where(o => o.BillingAddress != null && !string.IsNullOrEmpty(o.BillingAddress.LastName) && o.BillingAddress.LastName.Contains(billingLastName));+ if (!string.IsNullOrEmpty(billingLastName))+ builderquery = builderquery.Where(o =>+ o.BillingAddress != null && !string.IsNullOrEmpty(o.BillingAddress.LastName) &&+ o.BillingAddress.LastName.Contains(billingLastName));- //tag filtering- if (!string.IsNullOrEmpty(tagId))- builderquery = builderquery.Where(o => o.OrderTags.Any(y => y == tagId));+ //tag filtering+ if (!string.IsNullOrEmpty(tagId))+ builderquery = builderquery.Where(o => o.OrderTags.Any(y => y == tagId));- var query = builderquery- .GroupBy(x => 1).Select(g => new OrderAverageReportLine {- CountOrders = g.Count(),- SumShippingExclTax = g.Sum(o => o.OrderShippingExclTax / o.CurrencyRate),- SumTax = g.Sum(o => o.OrderTax / o.CurrencyRate),- SumOrders = g.Sum(o => o.OrderTotal / o.CurrencyRate)- }).ToList();+ var query = builderquery+ .GroupBy(x => 1).Select(g => new OrderAverageReportLine {+ CountOrders = g.Count(),+ SumShippingExclTax = g.Sum(o => o.OrderShippingExclTax / o.CurrencyRate),+ SumTax = g.Sum(o => o.OrderTax / o.CurrencyRate),+ SumOrders = g.Sum(o => o.OrderTotal / o.CurrencyRate)+ }).ToList();- var item2 = query.Count > 0 ? query.FirstOrDefault() : new OrderAverageReportLine {+ var item2 = query.Count > 0+ ? query.FirstOrDefault()+ : new OrderAverageReportLine {CountOrders = 0,SumShippingExclTax = 0,SumTax = 0,SumOrders = 0};- return await Task.FromResult(item2);+ return await Task.FromResult(item2);+ }++ /// <summary>+ /// Get order average report+ /// </summary>+ /// <param name="storeId">Store identifier</param>+ /// <param name="os">Order status</param>+ /// <returns>Result</returns>+ public virtual async Task<OrderAverageReportLineSummary> OrderAverageReport(string storeId, int os)+ {+ var item = new OrderAverageReportLineSummary {+ OrderStatus = os+ };++ var nowDt = _dateTimeService.ConvertToUserTime(DateTime.Now);+ var timeZone = _dateTimeService.CurrentTimeZone;++ //today+ var t1 = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day);+ if (!timeZone.IsInvalidTime(t1))+ {+ DateTime? startTime1 = _dateTimeService.ConvertToUtcTime(t1, timeZone);+ var todayResult = await GetOrderAverageReportLine(storeId,+ os: os,+ startTimeUtc: startTime1);+ item.SumTodayOrders = todayResult.SumOrders;+ item.CountTodayOrders = todayResult.CountOrders;}- /// <summary>- /// Get order average report- /// </summary>- /// <param name="storeId">Store identifier</param>- /// <param name="os">Order status</param>- /// <returns>Result</returns>- public virtual async Task<OrderAverageReportLineSummary> OrderAverageReport(string storeId, int os)+ //week+ var fdow = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;+ var today = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day);+ var t2 = today.AddDays(-(today.DayOfWeek - fdow));+ if (!timeZone.IsInvalidTime(t2)){- var item = new OrderAverageReportLineSummary {- OrderStatus = os- };+ DateTime? startTime2 = _dateTimeService.ConvertToUtcTime(t2, timeZone);+ var weekResult = await GetOrderAverageReportLine(storeId,+ os: os,+ startTimeUtc: startTime2);+ item.SumThisWeekOrders = weekResult.SumOrders;+ item.CountThisWeekOrders = weekResult.CountOrders;+ }- DateTime nowDt = _dateTimeService.ConvertToUserTime(DateTime.Now);- TimeZoneInfo timeZone = _dateTimeService.CurrentTimeZone;-- //today- var t1 = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day);- if (!timeZone.IsInvalidTime(t1))- {- DateTime? startTime1 = _dateTimeService.ConvertToUtcTime(t1, timeZone);- var todayResult = await GetOrderAverageReportLine(storeId: storeId,- os: os,- startTimeUtc: startTime1);- item.SumTodayOrders = todayResult.SumOrders;- item.CountTodayOrders = todayResult.CountOrders;- }- //week- DayOfWeek fdow = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;- var today = new DateTime(nowDt.Year, nowDt.Month, nowDt.Day);- DateTime t2 = today.AddDays(-(today.DayOfWeek - fdow));- if (!timeZone.IsInvalidTime(t2))- {- DateTime? startTime2 = _dateTimeService.ConvertToUtcTime(t2, timeZone);- var weekResult = await GetOrderAverageReportLine(storeId: storeId,- os: os,- startTimeUtc: startTime2);- item.SumThisWeekOrders = weekResult.SumOrders;- item.CountThisWeekOrders = weekResult.CountOrders;- }- //month- var t3 = new DateTime(nowDt.Year, nowDt.Month, 1);- if (!timeZone.IsInvalidTime(t3))- {- DateTime? startTime3 = _dateTimeService.ConvertToUtcTime(t3, timeZone);- var monthResult = await GetOrderAverageReportLine(storeId: storeId,- os: os,- startTimeUtc: startTime3);- item.SumThisMonthOrders = monthResult.SumOrders;- item.CountThisMonthOrders = monthResult.CountOrders;- }- //year- var t4 = new DateTime(nowDt.Year, 1, 1);- if (!timeZone.IsInvalidTime(t4))- {- DateTime? startTime4 = _dateTimeService.ConvertToUtcTime(t4, timeZone);- var yearResult = await GetOrderAverageReportLine(storeId: storeId,- os: os,- startTimeUtc: startTime4);- item.SumThisYearOrders = yearResult.SumOrders;- item.CountThisYearOrders = yearResult.CountOrders;- }- //all time- var allTimeResult = await GetOrderAverageReportLine(storeId: storeId, os: os);- item.SumAllTimeOrders = allTimeResult.SumOrders;- item.CountAllTimeOrders = allTimeResult.CountOrders;-- return item;+ //month+ var t3 = new DateTime(nowDt.Year, nowDt.Month, 1);+ if (!timeZone.IsInvalidTime(t3))+ {+ DateTime? startTime3 = _dateTimeService.ConvertToUtcTime(t3, timeZone);+ var monthResult = await GetOrderAverageReportLine(storeId,+ os: os,+ startTimeUtc: startTime3);+ item.SumThisMonthOrders = monthResult.SumOrders;+ item.CountThisMonthOrders = monthResult.CountOrders;}- /// <summary>- /// Get best sellers report- /// </summary>- /// <param name="storeId">Store identifier</param>- /// <param name="vendorId">Vendor identifier</param>- /// <param name="createdFromUtc">Order created date from (UTC); null to load all records</param>- /// <param name="createdToUtc">Order created date to (UTC); null to load all records</param>- /// <param name="os">Order status; null to load all records</param>- /// <param name="ps">Order payment status; null to load all records</param>- /// <param name="ss">Shipping status; null to load all records</param>- /// <param name="billingCountryId">Billing country identifier; "" to load all records</param>- /// <param name="orderBy">1 - order by quantity, 2 - order by total amount</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <param name="showHidden">A value indicating whether to show hidden records</param>- /// <returns>Result</returns>- public virtual async Task<IPagedList<BestsellersReportLine>> BestSellersReport(- string storeId = "", string vendorId = "",- DateTime? createdFromUtc = null, DateTime? createdToUtc = null,- int? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null,- string billingCountryId = "",- int orderBy = 1,- int pageIndex = 0, int pageSize = int.MaxValue,- bool showHidden = false)+ //year+ var t4 = new DateTime(nowDt.Year, 1, 1);+ if (!timeZone.IsInvalidTime(t4)){- var builderquery = from p in _orderRepository.Table- select p;-- builderquery = builderquery.Where(o => !o.Deleted);-- if (!string.IsNullOrEmpty(storeId))- builderquery = builderquery.Where(o => o.StoreId == storeId);-- if (!string.IsNullOrEmpty(vendorId))- {- builderquery = builderquery- .Where(o => o.OrderItems+ DateTime? startTime4 = _dateTimeService.ConvertToUtcTime(t4, timeZone);+ var yearResult = await GetOrderAverageReportLine(storeId,+ os: os,+ startTimeUtc: startTime4);+ item.SumThisYearOrders = yearResult.SumOrders;+ item.CountThisYearOrders = yearResult.CountOrders;+ }++ //all time+ var allTimeResult = await GetOrderAverageReportLine(storeId, os: os);+ item.SumAllTimeOrders = allTimeResult.SumOrders;+ item.CountAllTimeOrders = allTimeResult.CountOrders;++ return item;+ }++ /// <summary>+ /// Get best sellers report+ /// </summary>+ /// <param name="storeId">Store identifier</param>+ /// <param name="vendorId">Vendor identifier</param>+ /// <param name="createdFromUtc">Order created date from (UTC); null to load all records</param>+ /// <param name="createdToUtc">Order created date to (UTC); null to load all records</param>+ /// <param name="os">Order status; null to load all records</param>+ /// <param name="ps">Order payment status; null to load all records</param>+ /// <param name="ss">Shipping status; null to load all records</param>+ /// <param name="billingCountryId">Billing country identifier; "" to load all records</param>+ /// <param name="orderBy">1 - order by quantity, 2 - order by total amount</param>+ /// <param name="pageIndex">Page index</param>+ /// <param name="pageSize">Page size</param>+ /// <param name="showHidden">A value indicating whether to show hidden records</param>+ /// <returns>Result</returns>+ public virtual async Task<IPagedList<BestsellersReportLine>> BestSellersReport(+ string storeId = "", string vendorId = "",+ DateTime? createdFromUtc = null, DateTime? createdToUtc = null,+ int? os = null, PaymentStatus? ps = null, ShippingStatus? ss = null,+ string billingCountryId = "",+ int orderBy = 1,+ int pageIndex = 0, int pageSize = int.MaxValue,+ bool showHidden = false)+ {+ var builderquery = from p in _orderRepository.Table+ select p;++ builderquery = builderquery.Where(o => !o.Deleted);++ if (!string.IsNullOrEmpty(storeId))+ builderquery = builderquery.Where(o => o.StoreId == storeId);++ if (!string.IsNullOrEmpty(vendorId))+ builderquery = builderquery+ .Where(o => o.OrderItems.Any(orderItem => orderItem.VendorId == vendorId));- }- if (!string.IsNullOrEmpty(billingCountryId))- builderquery = builderquery.Where(o => o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId);--- if (os.HasValue)- builderquery = builderquery.Where(o => o.OrderStatusId == os.Value);- if (ps.HasValue)- builderquery = builderquery.Where(o => o.PaymentStatusId == ps.Value);- if (ss.HasValue)- builderquery = builderquery.Where(o => o.ShippingStatusId == ss.Value);- if (createdFromUtc.HasValue)- builderquery = builderquery.Where(o => createdFromUtc.Value <= o.CreatedOnUtc);- if (createdToUtc.HasValue)- builderquery = builderquery.Where(o => createdToUtc.Value >= o.CreatedOnUtc);-- var query = from p in builderquery- from item in p.OrderItems- select new {- item.VendorId,- item.ProductId,- item.Quantity,- item.PriceInclTax,- p.Rate };-- if (!string.IsNullOrEmpty(vendorId))- {- query = query.Where(x => x.VendorId == vendorId);- }-- var queryItem = query.GroupBy(x => new { x.ProductId }).Select(x => new BestsellersReportLine {- ProductId = x.Key.ProductId,- TotalAmount = x.Sum(y => y.PriceInclTax / y.Rate),- TotalQuantity = x.Sum(y => y.Quantity)- });+ if (!string.IsNullOrEmpty(billingCountryId))+ builderquery = builderquery.Where(o =>+ o.BillingAddress != null && o.BillingAddress.CountryId == billingCountryId);+++ if (os.HasValue)+ builderquery = builderquery.Where(o => o.OrderStatusId == os.Value);+ if (ps.HasValue)+ builderquery = builderquery.Where(o => o.PaymentStatusId == ps.Value);+ if (ss.HasValue)+ builderquery = builderquery.Where(o => o.ShippingStatusId == ss.Value);+ if (createdFromUtc.HasValue)+ builderquery = builderquery.Where(o => createdFromUtc.Value <= o.CreatedOnUtc);+ if (createdToUtc.HasValue)+ builderquery = builderquery.Where(o => createdToUtc.Value >= o.CreatedOnUtc);++ var query = from p in builderquery+ from item in p.OrderItems+ select new {+ item.VendorId,+ item.ProductId,+ item.Quantity,+ item.PriceInclTax,+ p.Rate+ };- var queryItemOrdered = orderBy == 1 ? queryItem.OrderByDescending(x => x.TotalQuantity).ToList() :- queryItem.OrderByDescending(x => x.TotalAmount).ToList();+ if (!string.IsNullOrEmpty(vendorId)) query = query.Where(x => x.VendorId == vendorId);- var result = new PagedList<BestsellersReportLine>(queryItemOrdered, pageIndex, pageSize);- return await Task.FromResult(result);- }+ var queryItem = query.GroupBy(x => new { x.ProductId }).Select(x => new BestsellersReportLine {+ ProductId = x.Key.ProductId,+ TotalAmount = x.Sum(y => y.PriceInclTax / y.Rate),+ TotalQuantity = x.Sum(y => y.Quantity)+ });+ var queryItemOrdered = orderBy == 1+ ? queryItem.OrderByDescending(x => x.TotalQuantity).ToList()+ : queryItem.OrderByDescending(x => x.TotalAmount).ToList();- /// <summary>- /// Gets a report of orders in the last days- /// </summary>- /// <param name="days">Orders in the last days</param>- /// <param name="storeId">Store ident</param>- /// <param name="salesEmployeeId">Sales employee ident</param>- /// <returns>ReportPeriodOrder</returns>- public virtual async Task<ReportPeriodOrder> GetOrderPeriodReport(int days, string storeId = "", string salesEmployeeId = "")- {- var currentdate = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day);- DateTime date = days != 0 ?- _dateTimeService.ConvertToUtcTime(currentdate, _dateTimeService.CurrentTimeZone).AddDays(-days) :- _dateTimeService.ConvertToUtcTime(currentdate, _dateTimeService.CurrentTimeZone);-- var query = from o in _orderRepository.Table- where !o.Deleted && o.CreatedOnUtc >= date- && (string.IsNullOrEmpty(storeId) || o.StoreId == storeId)- && (string.IsNullOrEmpty(salesEmployeeId) || o.SeId == salesEmployeeId)- group o by 1 into g- select new ReportPeriodOrder { Amount = g.Sum(x => x.OrderTotal / x.CurrencyRate), Count = g.Count() };- var report = query.ToList()?.FirstOrDefault() ?? new ReportPeriodOrder();- report.Date = date;- return await Task.FromResult(report);- }+ var result = new PagedList<BestsellersReportLine>(queryItemOrdered, pageIndex, pageSize);+ return await Task.FromResult(result);+ }+ /// <summary>+ /// Gets a report of orders in the last days+ /// </summary>+ /// <param name="days">Orders in the last days</param>+ /// <param name="storeId">Store ident</param>+ /// <param name="salesEmployeeId">Sales employee ident</param>+ /// <returns>ReportPeriodOrder</returns>+ public virtual async Task<ReportPeriodOrder> GetOrderPeriodReport(int days, string storeId = "",+ string salesEmployeeId = "")+ {+ var currentdate = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day);+ var date = days != 0+ ? _dateTimeService.ConvertToUtcTime(currentdate, _dateTimeService.CurrentTimeZone).AddDays(-days)+ : _dateTimeService.ConvertToUtcTime(currentdate, _dateTimeService.CurrentTimeZone);++ var query = from o in _orderRepository.Table+ where !o.Deleted && o.CreatedOnUtc >= date+ && (string.IsNullOrEmpty(storeId) || o.StoreId == storeId)+ && (string.IsNullOrEmpty(salesEmployeeId) || o.SeId == salesEmployeeId)+ group o by 1+ into g+ select new ReportPeriodOrder { Amount = g.Sum(x => x.OrderTotal / x.CurrencyRate), Count = g.Count() };+ var report = query.ToList()?.FirstOrDefault() ?? new ReportPeriodOrder();+ report.Date = date;+ return await Task.FromResult(report);+ }- /// <summary>- /// Gets a list of products (identifiers) purchased by other customers who purchased a specified product- /// </summary>- /// <param name="storeId">Store identifier</param>- /// <param name="productId">Product identifier</param>- /// <param name="recordsToReturn">Records to return</param>- /// <param name="showHidden">A value indicating whether to show hidden records</param>- /// <returns>Products</returns>- public virtual async Task<string[]> GetAlsoPurchasedProductsIds(string storeId, string productId,- int recordsToReturn = 5, bool showHidden = false)- {- var product = from p in _productAlsoPurchasedRepository.Table- where p.ProductId == productId- group p by p.ProductId2 into g- select new- {- ProductId = g.Key,- ProductsPurchased = g.Sum(x => x.Quantity)- };- product = product.OrderByDescending(x => x.ProductsPurchased);- if (recordsToReturn > 0)- product = product.Take(recordsToReturn);-- var report = product.ToList();-- return await Task.FromResult(report.Select(reportLine => reportLine.ProductId).ToArray());- }- /// <summary>- /// Gets a list of products that were never sold- /// </summary>- /// <param name="storeId">Store identifier</param>- /// <param name="vendorId">Vendor identifier</param>- /// <param name="createdFromUtc">Order created date from (UTC); null to load all records</param>- /// <param name="createdToUtc">Order created date to (UTC); null to load all records</param>- /// <param name="pageIndex">Page index</param>- /// <param name="pageSize">Page size</param>- /// <param name="showHidden">A value indicating whether to show hidden records</param>- /// <returns>Products</returns>- public virtual async Task<IPagedList<Product>> ProductsNeverSold(string storeId = "", string vendorId = "",- DateTime? createdFromUtc = null, DateTime? createdToUtc = null,- int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false)- {+ /// <summary>+ /// Gets a list of products (identifiers) purchased by other customers who purchased a specified product+ /// </summary>+ /// <param name="storeId">Store identifier</param>+ /// <param name="productId">Product identifier</param>+ /// <param name="recordsToReturn">Records to return</param>+ /// <param name="showHidden">A value indicating whether to show hidden records</param>+ /// <returns>Products</returns>+ public virtual async Task<string[]> GetAlsoPurchasedProductsIds(string storeId, string productId,+ int recordsToReturn = 5, bool showHidden = false)+ {+ var product = from p in _productAlsoPurchasedRepository.Table+ where p.ProductId == productId+ group p by p.ProductId2+ into g+ select new {+ ProductId = g.Key,+ ProductsPurchased = g.Sum(x => x.Quantity)+ };+ product = product.OrderByDescending(x => x.ProductsPurchased);+ if (recordsToReturn > 0)+ product = product.Take(recordsToReturn);- createdFromUtc ??= DateTime.MinValue;- createdToUtc ??= DateTime.MaxValue;-- var query = (from order in _orderRepository.Table- where- (string.IsNullOrEmpty(storeId) || order.StoreId == storeId) &&- createdFromUtc.Value <= order.CreatedOnUtc &&- createdToUtc.Value >= order.CreatedOnUtc &&- !order.Deleted- from orderItem in order.OrderItems- select new { orderItem.ProductId }).ToList().Distinct().Select(x => x.ProductId);-- var qproducts = from p in _productRepository.Table- orderby p.Name- where !query.Contains(p.Id) &&- //include only simple products- p.ProductTypeId == ProductType.SimpleProduct &&- (vendorId == "" || p.VendorId == vendorId) &&- (string.IsNullOrEmpty(storeId) || p.Stores.Contains(storeId) || p.LimitedToStores == false) &&- (showHidden || p.Published)- select p;-- return await PagedList<Product>.Create(qproducts, pageIndex, pageSize);- }+ var report = product.ToList();- public class OrderStats- {- public int Year { get; set; }- public int Month { get; set; }- public int Day { get; set; }- public int Count { get; set; }- public double Amount { get; set; }- }+ return await Task.FromResult(report.Select(reportLine => reportLine.ProductId).ToArray());+ }- #endregion+ /// <summary>+ /// Gets a list of products that were never sold+ /// </summary>+ /// <param name="storeId">Store identifier</param>+ /// <param name="vendorId">Vendor identifier</param>+ /// <param name="createdFromUtc">Order created date from (UTC); null to load all records</param>+ /// <param name="createdToUtc">Order created date to (UTC); null to load all records</param>+ /// <param name="pageIndex">Page index</param>+ /// <param name="pageSize">Page size</param>+ /// <param name="showHidden">A value indicating whether to show hidden records</param>+ /// <returns>Products</returns>+ public virtual async Task<IPagedList<Product>> ProductsNeverSold(string storeId = "", string vendorId = "",+ DateTime? createdFromUtc = null, DateTime? createdToUtc = null,+ int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false)+ {+ createdFromUtc ??= DateTime.MinValue;+ createdToUtc ??= DateTime.MaxValue;++ var query = (from order in _orderRepository.Table+ where+ (string.IsNullOrEmpty(storeId) || order.StoreId == storeId) &&+ createdFromUtc.Value <= order.CreatedOnUtc &&+ createdToUtc.Value >= order.CreatedOnUtc &&+ !order.Deleted+ from orderItem in order.OrderItems+ select new { orderItem.ProductId }).ToList().Distinct().Select(x => x.ProductId);++ var qproducts = from p in _productRepository.Table+ orderby p.Name+ where !query.Contains(p.Id) &&+ //include only simple products+ p.ProductTypeId == ProductType.SimpleProduct &&+ (vendorId == "" || p.VendorId == vendorId) &&+ (string.IsNullOrEmpty(storeId) || p.Stores.Contains(storeId) || p.LimitedToStores == false) &&+ (showHidden || p.Published)+ select p;++ return await PagedList<Product>.Create(qproducts, pageIndex, pageSize);}-}++ public class OrderStats+ {+ public int Year { get; set; }+ public int Month { get; set; }+ public int Day { get; set; }+ public int Count { get; set; }+ public double Amount { get; set; }+ }++ #endregion+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs b/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.csindex b1644fc4c..42e842d31 100644--- a/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs+++ b/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs@@ -1,81 +1,81 @@using Grand.Business.Core.Interfaces.System.Reports;using Grand.Business.Core.Utilities.System;-using Grand.Domain.Catalog;using Grand.Data;+using Grand.Domain.Catalog;++namespace Grand.Business.System.Services.Reports;-namespace Grand.Business.System.Services.Reports+/// <summary>+/// Product report service+/// </summary>+public class ProductsReportService : IProductsReportService{- /// <summary>- /// Product report service- /// </summary>- public class ProductsReportService : IProductsReportService- {- #region Fields+ #region Fields- private readonly IRepository<Product> _productRepository;+ private readonly IRepository<Product> _productRepository;- #endregion+ #endregion- #region CTOR+ #region CTOR- public ProductsReportService(IRepository<Product> productRepository)- {- _productRepository = productRepository;- }+ public ProductsReportService(IRepository<Product> productRepository)+ {+ _productRepository = productRepository;+ }- #endregion+ #endregion- /// <summary>- /// Get "low stock products" report- /// </summary>- /// <param name="vendorId">Vendor identifier</param>- /// <param name="storeId">Store identifier</param>- /// <returns>Result</returns>- public virtual async Task<(IList<Product> products, IList<ProductsAttributeCombination> combinations)> LowStockProducts(string vendorId = "", string storeId = "")- {- //Track inventory for product- //simple products- var querySimpleProducts = from p in _productRepository.Table- where p.LowStock &&- (p.ProductTypeId == ProductType.SimpleProduct || p.ProductTypeId == ProductType.BundledProduct)- && p.ManageInventoryMethodId == ManageInventoryMethod.ManageStock- select p;+ /// <summary>+ /// Get "low stock products" report+ /// </summary>+ /// <param name="vendorId">Vendor identifier</param>+ /// <param name="storeId">Store identifier</param>+ /// <returns>Result</returns>+ public virtual async Task<(IList<Product> products, IList<ProductsAttributeCombination> combinations)>+ LowStockProducts(string vendorId = "", string storeId = "")+ {+ //Track inventory for product+ //simple products+ var querySimpleProducts = from p in _productRepository.Table+ where p.LowStock &&+ (p.ProductTypeId == ProductType.SimpleProduct || p.ProductTypeId == ProductType.BundledProduct)+ && p.ManageInventoryMethodId == ManageInventoryMethod.ManageStock+ select p;- if (!string.IsNullOrEmpty(vendorId))- querySimpleProducts = querySimpleProducts.Where(x => x.VendorId == vendorId);+ if (!string.IsNullOrEmpty(vendorId))+ querySimpleProducts = querySimpleProducts.Where(x => x.VendorId == vendorId);- if (!string.IsNullOrEmpty(storeId))- querySimpleProducts = querySimpleProducts.Where(x => x.Stores.Contains(storeId));+ if (!string.IsNullOrEmpty(storeId))+ querySimpleProducts = querySimpleProducts.Where(x => x.Stores.Contains(storeId));- var products = querySimpleProducts.ToList();+ var products = querySimpleProducts.ToList();- //Track inventory for product by product attributes- var query2_1 = from p in _productRepository.Table- where- p.ManageInventoryMethodId == ManageInventoryMethod.ManageStockByAttributes &&- (vendorId == "" || p.VendorId == vendorId) &&- (storeId == "" || p.Stores.Contains(storeId))- from c in p.ProductAttributeCombinations- select new ProductsAttributeCombination {- ProductId = p.Id,- StockQuantity = c.StockQuantity,- Attributes = c.Attributes,- AllowOutOfStockOrders = c.AllowOutOfStockOrders,- Id = c.Id,- Gtin = c.Gtin,- Mpn = c.Mpn,- NotifyAdminForQuantityBelow = c.NotifyAdminForQuantityBelow,- OverriddenPrice = c.OverriddenPrice,- Sku = c.Sku- };+ //Track inventory for product by product attributes+ var query2_1 = from p in _productRepository.Table+ where+ p.ManageInventoryMethodId == ManageInventoryMethod.ManageStockByAttributes &&+ (vendorId == "" || p.VendorId == vendorId) &&+ (storeId == "" || p.Stores.Contains(storeId))+ from c in p.ProductAttributeCombinations+ select new ProductsAttributeCombination {+ ProductId = p.Id,+ StockQuantity = c.StockQuantity,+ Attributes = c.Attributes,+ AllowOutOfStockOrders = c.AllowOutOfStockOrders,+ Id = c.Id,+ Gtin = c.Gtin,+ Mpn = c.Mpn,+ NotifyAdminForQuantityBelow = c.NotifyAdminForQuantityBelow,+ OverriddenPrice = c.OverriddenPrice,+ Sku = c.Sku+ };- var query2_2 = from c in query2_1- where c.StockQuantity <= 0- select c;+ var query2_2 = from c in query2_1+ where c.StockQuantity <= 0+ select c;- var combinations = query2_2.ToList();+ var combinations = query2_2.ToList();- return await Task.FromResult((products, combinations));- }+ return await Task.FromResult((products, combinations));}-}+}\ No newline at end of filediff --git a/src/Business/Grand.Business.System/Startup/StartupApplication.cs b/src/Business/Grand.Business.System/Startup/StartupApplication.csindex 28be141dd..1dd22de98 100644--- a/src/Business/Grand.Business.System/Startup/StartupApplication.cs+++ b/src/Business/Grand.Business.System/Startup/StartupApplication.cs@@ -18,76 +18,71 @@ using Microsoft.AspNetCore.Hosting;using Microsoft.Extensions.Configuration;using Microsoft.Extensions.DependencyInjection;-namespace Grand.Business.System.Startup+namespace Grand.Business.System.Startup;++public class StartupApplication : IStartupApplication{- public class StartupApplication : IStartupApplication+ public void ConfigureServices(IServiceCollection services, IConfiguration configuration){- public void ConfigureServices(IServiceCollection services, IConfiguration configuration)- {- RegisterReports(services);- RegisterMachineNameProvider(services, configuration);- RegisterTask(services);- RegisterInstallService(services);- RegisterAdmin(services);- }- public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)- {+ RegisterReports(services);+ RegisterMachineNameProvider(services, configuration);+ RegisterTask(services);+ RegisterInstallService(services);+ RegisterAdmin(services);+ }- }- public int Priority => 100;- public bool BeforeConfigure => false;+ public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)+ {+ }- private void RegisterTask(IServiceCollection serviceCollection)- {- serviceCollection.AddScoped<IScheduleTaskService, ScheduleTaskService>();+ public int Priority => 100;+ public bool BeforeConfigure => false;- serviceCollection.AddScoped<IScheduleTask, QueuedMessagesSendScheduleTask>();- serviceCollection.AddScoped<IScheduleTask, ClearCacheScheduleTask>();- serviceCollection.AddScoped<IScheduleTask, GenerateSitemapXmlTask>();- serviceCollection.AddScoped<IScheduleTask, DeleteGuestsScheduleTask>();- serviceCollection.AddScoped<IScheduleTask, UpdateExchangeRateScheduleTask>();- serviceCollection.AddScoped<IScheduleTask, EndAuctionsTask>();- serviceCollection.AddScoped<IScheduleTask, CancelOrderScheduledTask>();+ private void RegisterTask(IServiceCollection serviceCollection)+ {+ serviceCollection.AddScoped<IScheduleTaskService, ScheduleTaskService>();- }+ serviceCollection.AddScoped<IScheduleTask, QueuedMessagesSendScheduleTask>();+ serviceCollection.AddScoped<IScheduleTask, ClearCacheScheduleTask>();+ serviceCollection.AddScoped<IScheduleTask, GenerateSitemapXmlTask>();+ serviceCollection.AddScoped<IScheduleTask, DeleteGuestsScheduleTask>();+ serviceCollection.AddScoped<IScheduleTask, UpdateExchangeRateScheduleTask>();+ serviceCollection.AddScoped<IScheduleTask, EndAuctionsTask>();+ serviceCollection.AddScoped<IScheduleTask, CancelOrderScheduledTask>();+ }- private void RegisterReports(IServiceCollection serviceCollection)- {- serviceCollection.AddScoped<ICustomerReportService, CustomerReportService>();- serviceCollection.AddScoped<IOrderReportService, OrderReportService>();- serviceCollection.AddScoped<IProductsReportService, ProductsReportService>();- }+ private void RegisterReports(IServiceCollection serviceCollection)+ {+ serviceCollection.AddScoped<ICustomerReportService, CustomerReportService>();+ serviceCollection.AddScoped<IOrderReportService, OrderReportService>();+ serviceCollection.AddScoped<IProductsReportService, ProductsReportService>();+ }- private void RegisterMachineNameProvider(IServiceCollection serviceCollection, IConfiguration configuration)- {- var config = new AzureConfig();- configuration.GetSection("Azure").Bind(config);- if (config.RunOnAzureWebApps)- {- serviceCollection.AddSingleton<IMachineNameProvider, AzureWebAppsMachineNameProvider>();- }- else- {- serviceCollection.AddSingleton<IMachineNameProvider, DefaultMachineNameProvider>();- }- }+ private void RegisterMachineNameProvider(IServiceCollection serviceCollection, IConfiguration configuration)+ {+ var config = new AzureConfig();+ configuration.GetSection("Azure").Bind(config);+ if (config.RunOnAzureWebApps)+ serviceCollection.AddSingleton<IMachineNameProvider, AzureWebAppsMachineNameProvider>();+ else+ serviceCollection.AddSingleton<IMachineNameProvider, DefaultMachineNameProvider>();+ }- private void RegisterInstallService(IServiceCollection serviceCollection)+ private void RegisterInstallService(IServiceCollection serviceCollection)+ {+ var databaseInstalled = DataSettingsManager.DatabaseIsInstalled();+ if (!databaseInstalled){- var databaseInstalled = DataSettingsManager.DatabaseIsInstalled();- if (!databaseInstalled)- {- //installation service- serviceCollection.AddScoped<IInstallationLocalizedService, InstallationLocalizedService>();- serviceCollection.AddScoped<IInstallationService, InstallationService>();- }-- serviceCollection.AddScoped<IMigrationProcess, MigrationProcess>();+ //installation service+ serviceCollection.AddScoped<IInstallationLocalizedService, InstallationLocalizedService>();+ serviceCollection.AddScoped<IInstallationService, InstallationService>();}- private void RegisterAdmin(IServiceCollection serviceCollection)- {- serviceCollection.AddScoped<IAdminSiteMapService, AdminSiteMapService>();- }+ serviceCollection.AddScoped<IMigrationProcess, MigrationProcess>();+ }++ private void RegisterAdmin(IServiceCollection serviceCollection)+ {+ serviceCollection.AddScoped<IAdminSiteMapService, AdminSiteMapService>();}-}+}\ No newline at end of file