diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000..3729ff0cd1
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index efe3e71127..f9cff86f5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -162,4 +162,7 @@ src/Modules/**/launchSettings.json
PublishProfiles/
logs/
src/Modules/**/wwwroot/admin/*.min.js
-.vscode
\ No newline at end of file
+.vscode
+
+**/data/*
+**/logs/*
\ No newline at end of file
diff --git a/SimplCommerce.sln b/SimplCommerce.sln
index 78a141ca08..fbbda79f4f 100644
--- a/SimplCommerce.sln
+++ b/SimplCommerce.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29020.237
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32421.90
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C9BFDDC4-5671-47A3-B57D-197C2A51FA8A}"
EndProject
@@ -134,6 +134,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Module.Paymen
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Module.PaymentCashfree", "src\Modules\SimplCommerce.Module.PaymentCashfree\SimplCommerce.Module.PaymentCashfree.csproj", "{E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Db.MsSql", "src\SimplCommerce.Db.MsSql\SimplCommerce.Db.MsSql.csproj", "{2FD1634B-E0ED-4E68-A993-57AAEF2B9474}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplCommerce.Db.PgSql", "src\SimplCommerce.Db.PgSql\SimplCommerce.Db.PgSql.csproj", "{61985132-75C9-4601-9030-6E2B76781E0F}"
+EndProject
+Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker\docker-compose.dcproj", "{59ACBE78-9B5D-4386-8291-253898925E48}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -696,6 +702,42 @@ Global
{E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}.Release|x64.Build.0 = Release|Any CPU
{E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}.Release|x86.ActiveCfg = Release|Any CPU
{E30CF10F-FABF-4917-8BEB-CB81E4CE2C92}.Release|x86.Build.0 = Release|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x64.Build.0 = Debug|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Debug|x86.Build.0 = Debug|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x64.ActiveCfg = Release|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x64.Build.0 = Release|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x86.ActiveCfg = Release|Any CPU
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474}.Release|x86.Build.0 = Release|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x64.Build.0 = Debug|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Debug|x86.Build.0 = Debug|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x64.ActiveCfg = Release|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x64.Build.0 = Release|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x86.ActiveCfg = Release|Any CPU
+ {61985132-75C9-4601-9030-6E2B76781E0F}.Release|x86.Build.0 = Release|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x64.Build.0 = Debug|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Debug|x86.Build.0 = Debug|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Release|Any CPU.Build.0 = Release|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x64.ActiveCfg = Release|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x64.Build.0 = Release|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x86.ActiveCfg = Release|Any CPU
+ {59ACBE78-9B5D-4386-8291-253898925E48}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -750,6 +792,8 @@ Global
{1A8B6FA0-8341-4D27-9B71-57F70AB37571} = {0A27C140-4CCB-40DD-BE48-F5DE16D1177B}
{14586564-62CC-4117-AC1B-858ED53C2D6C} = {7EFA2FA7-32DD-4047-B021-50E77A83D714}
{E30CF10F-FABF-4917-8BEB-CB81E4CE2C92} = {7EFA2FA7-32DD-4047-B021-50E77A83D714}
+ {2FD1634B-E0ED-4E68-A993-57AAEF2B9474} = {C9BFDDC4-5671-47A3-B57D-197C2A51FA8A}
+ {61985132-75C9-4601-9030-6E2B76781E0F} = {C9BFDDC4-5671-47A3-B57D-197C2A51FA8A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B9D0D8F0-1AB9-44DD-839F-ED8CEE7DDB10}
diff --git a/docker/.env b/docker/.env
new file mode 100644
index 0000000000..0cd43d0fb2
--- /dev/null
+++ b/docker/.env
@@ -0,0 +1,8 @@
+ASPNETCORE_ENVIRONMENT=Development
+
+VOLUMES_BASEPATH=./storage
+
+POSTGRES_USER=postgres
+POSTGRES_PASSWORD=postgres
+POSTGRES_DB=postgres
+
diff --git a/docker/create_docker_folders.bat b/docker/create_docker_folders.bat
new file mode 100644
index 0000000000..3c2110d321
--- /dev/null
+++ b/docker/create_docker_folders.bat
@@ -0,0 +1,3 @@
+md docker\storage
+md docker\storage\postgres
+md docker\storage\postgres\data
\ No newline at end of file
diff --git a/docker/create_docker_folders.sh b/docker/create_docker_folders.sh
new file mode 100644
index 0000000000..bc056c0e04
--- /dev/null
+++ b/docker/create_docker_folders.sh
@@ -0,0 +1,3 @@
+mkdir -p ./docker/storage/postgres/data
+
+chmod -R 777 ./docker/storage
diff --git a/docker/docker-compose.dcproj b/docker/docker-compose.dcproj
new file mode 100644
index 0000000000..0694d9ee68
--- /dev/null
+++ b/docker/docker-compose.dcproj
@@ -0,0 +1,55 @@
+
+
+
+ 2.1
+ Linux
+ 59acbe78-9b5d-4386-8291-253898925e48
+ LaunchBrowser
+ {Scheme}://localhost:{ServicePort}/swagger
+ SimplCommerce
+ SimplCommerce
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ docker-compose.yml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docker/docker-compose.override.yml b/docker/docker-compose.override.yml
new file mode 100644
index 0000000000..8e89b0713c
--- /dev/null
+++ b/docker/docker-compose.override.yml
@@ -0,0 +1 @@
+version: '3.4'
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
new file mode 100644
index 0000000000..3ece5e1a9c
--- /dev/null
+++ b/docker/docker-compose.yml
@@ -0,0 +1,29 @@
+version: '3.4'
+
+services:
+ simplcommerce:
+ build:
+ context: ../
+ dockerfile: src/SimplCommerce.WebHost/Dockerfile
+ environment:
+ ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT}
+ ASPNETCORE_URLS: ${ASPNETCORE_URLS:-http://+:80;https://+:443}
+ ConnectionStrings__DefaultConnection: Host=postgres;Database=${POSTGRES_DB};Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD};
+ volumes:
+ - ${VOLUMES_BASEPATH}/logs:/app/logs
+ ports:
+ - "5000:80"
+ - "5001:443"
+
+ postgres:
+ image: postgres:latest
+ restart: always
+ environment:
+ POSTGRES_USER: ${POSTGRES_USER}
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
+ POSTGRES_DB: ${POSTGRES_DB}
+ ports:
+ - "15432:5432"
+ - "8085:8080"
+ volumes:
+ - ${VOLUMES_BASEPATH}/postgres/data:/var/lib/postgresql/data
diff --git a/src/Database/StaticData-TR.sql b/src/Database/StaticData-TR.sql
index cb68c5abf8..6b57f1787a 100644
--- a/src/Database/StaticData-TR.sql
+++ b/src/Database/StaticData-TR.sql
@@ -1,7 +1,7 @@
INSERT [dbo].[Localization_Culture] ([Id], [Name]) VALUES ('tr-TR', N'Turkish')
GO
-INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Register', N'Kayıt olmak')
+INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Register', N'Kayıt olun')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Hello {0}!', N'Merhaba {0}!')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Log in', N'Oturum aç')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Log off', N'Oturumu Kapat')
@@ -197,7 +197,7 @@ INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-T
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Account Information', N'Hesap Bilgileri')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Edit', N'Düzenle')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Security', N'Güvenlik')
-INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Create', N'yaratmak')
+INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Create', N'Oluştur')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'External Logins', N'Harici Girişler')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Manage', N'Yönet')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Default shipping address', N'Varsayılan kargo adresi')
diff --git a/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs b/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs
index 02015111a7..1c011a6c54 100644
--- a/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs
+++ b/src/Modules/SimplCommerce.Module.ActivityLog/Events/EntityViewedHandler.cs
@@ -30,7 +30,7 @@ public async Task Handle(EntityViewed notification, CancellationToken cancellati
EntityId = notification.EntityId,
EntityTypeId = notification.EntityTypeId,
UserId = user.Id,
- CreatedOn = DateTimeOffset.Now
+ CreatedOn = DateTimeOffset.UtcNow
};
_activityRepository.Add(activity);
diff --git a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs
index 78fe38db63..8c39b42a84 100644
--- a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs
+++ b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductApiController.cs
@@ -754,7 +754,7 @@ private async Task AddOrDeleteProductVariation(User loginUser, ProductForm mode
}
productLink.LinkedProduct.LatestUpdatedById = loginUser.Id;
- productLink.LinkedProduct.LatestUpdatedOn = DateTimeOffset.Now;
+ productLink.LinkedProduct.LatestUpdatedOn = DateTimeOffset.UtcNow;
productLink.LinkedProduct.Sku = productVariationVm.Sku;
productLink.LinkedProduct.Gtin = productVariationVm.Gtin;
productLink.LinkedProduct.Price = productVariationVm.Price;
diff --git a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs
index 746c6df985..27f7082ef6 100644
--- a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs
+++ b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Controllers/ProductCloneApiController.cs
@@ -66,8 +66,8 @@ public async Task Post([FromBody] ProductCloneFormVm model)
newProduct.Slug = model.Slug;
newProduct.CreatedById = currentUser.Id;
newProduct.LatestUpdatedById = currentUser.Id;
- newProduct.CreatedOn = DateTimeOffset.Now;
- newProduct.LatestUpdatedOn = DateTimeOffset.Now;
+ newProduct.CreatedOn = DateTimeOffset.UtcNow;
+ newProduct.LatestUpdatedOn = DateTimeOffset.UtcNow;
var productPriceHistory = CreatePriceHistory(currentUser, newProduct);
newProduct.PriceHistories.Add(productPriceHistory);
diff --git a/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs b/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs
index 720ab0253c..c4f8b1c740 100644
--- a/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs
+++ b/src/Modules/SimplCommerce.Module.Catalog/Models/ProductPriceHistory.cs
@@ -9,7 +9,7 @@ public class ProductPriceHistory : EntityBase
{
public ProductPriceHistory()
{
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
public Product Product { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs b/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs
index c4ca725914..8f1a212be2 100644
--- a/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs
+++ b/src/Modules/SimplCommerce.Module.Catalog/Services/ProductPricingService.cs
@@ -29,7 +29,7 @@ public CalculatedProductPrice CalculateProductPrice(decimal price, decimal? oldP
var percentOfSaving = 0;
var calculatedPrice = price;
- if (specialPrice.HasValue && specialPriceStart < DateTimeOffset.Now && DateTimeOffset.Now < specialPriceEnd)
+ if (specialPrice.HasValue && specialPriceStart < DateTimeOffset.UtcNow && DateTimeOffset.UtcNow < specialPriceEnd)
{
calculatedPrice = specialPrice.Value;
diff --git a/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs b/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs
index 9a201e2122..5d2164f0f6 100644
--- a/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs
+++ b/src/Modules/SimplCommerce.Module.Cms/Areas/Cms/Controllers/PageApiController.cs
@@ -110,7 +110,7 @@ public async Task Put(long id, [FromBody] PageForm model)
page.MetaDescription = model.MetaDescription;
page.Body = model.Body;
page.IsPublished = model.IsPublished;
- page.LatestUpdatedOn = DateTimeOffset.Now;
+ page.LatestUpdatedOn = DateTimeOffset.UtcNow;
page.LatestUpdatedBy = currentUser;
await _pageService.Update(page);
diff --git a/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs b/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs
index 6876cceba7..4d0f55ab44 100644
--- a/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs
+++ b/src/Modules/SimplCommerce.Module.Comments/Models/Comment.cs
@@ -11,7 +11,7 @@ public class Comment : EntityBase
public Comment()
{
Status = CommentStatus.Approved;
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
public long UserId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs b/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs
index 66d1b525f6..dfdc600099 100644
--- a/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs
+++ b/src/Modules/SimplCommerce.Module.Contacts/Models/Contact.cs
@@ -8,7 +8,7 @@ public class Contact : EntityBase
{
public Contact()
{
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
[StringLength(450)]
diff --git a/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs b/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs
index 1cfb0908ce..73d9bf5d7f 100644
--- a/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Areas/Core/Controllers/CustomerGroupApiController.cs
@@ -135,7 +135,7 @@ public async Task Put(long id, [FromBody] CustomerGroupForm model
customerGroup.Name = model.Name;
customerGroup.Description = model.Description;
customerGroup.IsActive = model.IsActive;
- customerGroup.LatestUpdatedOn = DateTimeOffset.Now;
+ customerGroup.LatestUpdatedOn = DateTimeOffset.UtcNow;
await _customerGroupRepository.SaveChangesAsync();
return Accepted();
diff --git a/src/Modules/SimplCommerce.Module.Core/Models/Content.cs b/src/Modules/SimplCommerce.Module.Core/Models/Content.cs
index 8ed1760dcc..97072898c3 100644
--- a/src/Modules/SimplCommerce.Module.Core/Models/Content.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Models/Content.cs
@@ -10,8 +10,8 @@ public abstract class Content : EntityBase
protected Content()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
[Required(ErrorMessage = "The {0} field is required.")]
diff --git a/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs b/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs
index 304b3e89c4..9451ea17af 100644
--- a/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Models/CustomerGroup.cs
@@ -9,8 +9,8 @@ public class CustomerGroup : EntityBase
{
public CustomerGroup()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
[Required(ErrorMessage = "The {0} field is required.")]
diff --git a/src/Modules/SimplCommerce.Module.Core/Models/User.cs b/src/Modules/SimplCommerce.Module.Core/Models/User.cs
index 5e6e8bd3fc..96c50c23bf 100644
--- a/src/Modules/SimplCommerce.Module.Core/Models/User.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Models/User.cs
@@ -10,8 +10,8 @@ public class User : IdentityUser, IEntityWithTypedId, IExtendableObj
{
public User()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
public const string SettingsDataKey = "Settings";
diff --git a/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs b/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs
index 46b21c807f..3ad925b066 100644
--- a/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Models/Vendor.cs
@@ -9,7 +9,7 @@ public class Vendor : EntityBase
{
public Vendor()
{
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
[Required(ErrorMessage = "The {0} field is required.")]
diff --git a/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs b/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs
index 6c0f0b7c14..63676ec3c2 100644
--- a/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Models/Widget.cs
@@ -9,7 +9,7 @@ public class Widget : EntityBaseWithTypedId
public Widget(string id)
{
Id = id;
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
public string Code
diff --git a/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs b/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs
index 9ff86cd88b..5b8c5ad02a 100644
--- a/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Models/WidgetInstance.cs
@@ -8,8 +8,8 @@ public class WidgetInstance : EntityBase
{
public WidgetInstance()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
[StringLength(450)]
@@ -45,7 +45,7 @@ public bool IsPublished
{
get
{
- return PublishStart.HasValue && PublishStart.Value < DateTimeOffset.Now && (!PublishEnd.HasValue || PublishEnd.Value > DateTimeOffset.Now);
+ return PublishStart.HasValue && PublishStart.Value < DateTimeOffset.UtcNow && (!PublishEnd.HasValue || PublishEnd.Value > DateTimeOffset.UtcNow);
}
}
}
diff --git a/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs b/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs
index 24158fed7c..376b83505f 100644
--- a/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs
+++ b/src/Modules/SimplCommerce.Module.Core/ModuleInitializer.cs
@@ -29,6 +29,7 @@ public void ConfigureServices(IServiceCollection serviceCollection)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
+ // Method intentionally left empty.
}
}
}
diff --git a/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs b/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs
index 4e49bbd69c..6b7999426c 100644
--- a/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Services/CurrencyService.cs
@@ -10,7 +10,7 @@ public class CurrencyService : ICurrencyService
public CurrencyService(IConfiguration config)
{
_config = config;
- var currencyCulture = _config.GetValue("Global.CurrencyCulture");
+ var currencyCulture = "tr-TR";// _config.GetValue("Global.CurrencyCulture");
CurrencyCulture = new CultureInfo(currencyCulture);
}
@@ -18,7 +18,7 @@ public CurrencyService(IConfiguration config)
public string FormatCurrency(decimal value)
{
- var decimalPlace = _config.GetValue("Global.CurrencyDecimalPlace");
+ var decimalPlace = 2;// _config.GetValue("Global.CurrencyDecimalPlace");
return value.ToString($"C{decimalPlace}", CurrencyCulture);
}
}
diff --git a/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs b/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs
index 360767f11c..2f5bb5362c 100644
--- a/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs
+++ b/src/Modules/SimplCommerce.Module.Core/Services/WidgetInstanceService.cs
@@ -16,7 +16,7 @@ public WidgetInstanceService(IRepository widgetInstanceRepositor
public IQueryable GetPublished()
{
- var now = DateTimeOffset.Now;
+ var now = DateTimeOffset.UtcNow;
return _widgetInstanceRepository.Query().Where(x =>
x.PublishStart.HasValue && x.PublishStart < now
&& (!x.PublishEnd.HasValue || x.PublishEnd > now));
diff --git a/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs b/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs
index 100a7a7b15..469d67c9c1 100644
--- a/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs
+++ b/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs
@@ -53,7 +53,7 @@ public async Task UpdateStock(StockUpdateRequest stockUpdateRequest)
AdjustedQuantity = stockUpdateRequest.AdjustedQuantity,
Note = stockUpdateRequest.Note,
CreatedById = stockUpdateRequest.UserId,
- CreatedOn = DateTimeOffset.Now,
+ CreatedOn = DateTimeOffset.UtcNow,
};
_stockHistoryRepository.Add(stockHistory);
diff --git a/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs b/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs
index 73ff74ca50..c2bc4c589f 100644
--- a/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs
+++ b/src/Modules/SimplCommerce.Module.News/Areas/News/Controllers/NewsItemApiController.cs
@@ -175,7 +175,7 @@ public async Task Put(long id, NewsItemForm model)
newsItem.ShortContent = model.ShortContent;
newsItem.FullContent = model.FullContent;
newsItem.IsPublished = model.IsPublished;
- newsItem.LatestUpdatedOn = DateTimeOffset.Now;
+ newsItem.LatestUpdatedOn = DateTimeOffset.UtcNow;
newsItem.LatestUpdatedBy = currentUser;
AddOrDeleteCategories(model, newsItem);
diff --git a/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs b/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs
index 2bdad81d5f..2130d01c27 100644
--- a/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs
+++ b/src/Modules/SimplCommerce.Module.Orders/Events/OrderChangedCreateOrderHistoryHandler.cs
@@ -22,7 +22,7 @@ public async Task Handle(OrderChanged notification, CancellationToken cancellati
var orderHistory = new OrderHistory
{
OrderId = notification.OrderId,
- CreatedOn = DateTimeOffset.Now,
+ CreatedOn = DateTimeOffset.UtcNow,
CreatedById = notification.UserId,
OldStatus = notification.OldStatus,
NewStatus = notification.NewStatus,
diff --git a/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs b/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs
index b9fcbfbb61..9a5144a9dd 100644
--- a/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs
+++ b/src/Modules/SimplCommerce.Module.Orders/Events/OrderCreatedCreateOrderHistoryHandler.cs
@@ -22,7 +22,7 @@ public async Task Handle(OrderCreated notification, CancellationToken cancellati
var orderHistory = new OrderHistory
{
OrderId = notification.Order.Id,
- CreatedOn = DateTimeOffset.Now,
+ CreatedOn = DateTimeOffset.UtcNow,
CreatedById = notification.Order.CreatedById,
NewStatus = OrderStatus.New,
Note = notification.Order.OrderNote,
diff --git a/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs b/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs
index 355a10d340..8ec6ca33c2 100644
--- a/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs
+++ b/src/Modules/SimplCommerce.Module.Orders/Models/Order.cs
@@ -11,8 +11,8 @@ public class Order : EntityBase
{
public Order()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
OrderStatus = OrderStatus.New;
IsMasterOrder = false;
}
diff --git a/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs b/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs
index 335a731ac6..ebf20015cd 100644
--- a/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs
+++ b/src/Modules/SimplCommerce.Module.Orders/Services/OrderCancellationBackgroundService.cs
@@ -45,7 +45,7 @@ protected async override Task ExecuteAsync(CancellationToken stoppingToken)
private async Task CancelFailedPaymentOrders(IRepository orderRepository, IOrderService orderService, IMediator mediator, CancellationToken stoppingToken)
{
- var durationToCancel = DateTimeOffset.Now.AddMinutes(-5);
+ var durationToCancel = DateTimeOffset.UtcNow.AddMinutes(-5);
var failedPaymentOrders = await orderRepository.Query().Where(x =>
(x.OrderStatus == OrderStatus.PendingPayment || x.OrderStatus == OrderStatus.PaymentFailed)
&& x.LatestUpdatedOn < durationToCancel).ToListAsync();
diff --git a/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs b/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs
index 7ed4429f15..5452ba8604 100644
--- a/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs
+++ b/src/Modules/SimplCommerce.Module.Orders/Services/OrderService.cs
@@ -196,9 +196,9 @@ public async Task> CreateOrder(long cartId, string paymentMethod,
var order = new Order
{
Customer = cart.Customer,
- CreatedOn = DateTimeOffset.Now,
+ CreatedOn = DateTimeOffset.UtcNow,
CreatedBy = cart.CreatedBy,
- LatestUpdatedOn = DateTimeOffset.Now,
+ LatestUpdatedOn = DateTimeOffset.UtcNow,
LatestUpdatedById = cart.CreatedById,
BillingAddress = orderBillingAddress,
ShippingAddress = orderShippingAddress,
@@ -274,9 +274,9 @@ public async Task> CreateOrder(long cartId, string paymentMethod,
var subOrder = new Order
{
CustomerId = cart.CustomerId,
- CreatedOn = DateTimeOffset.Now,
+ CreatedOn = DateTimeOffset.UtcNow,
CreatedById = cart.CreatedById,
- LatestUpdatedOn = DateTimeOffset.Now,
+ LatestUpdatedOn = DateTimeOffset.UtcNow,
LatestUpdatedById = cart.CreatedById,
BillingAddress = orderBillingAddress,
ShippingAddress = orderShippingAddress,
@@ -339,7 +339,7 @@ public async Task> CreateOrder(long cartId, string paymentMethod,
public void CancelOrder(Order order)
{
order.OrderStatus = OrderStatus.Canceled;
- order.LatestUpdatedOn = DateTimeOffset.Now;
+ order.LatestUpdatedOn = DateTimeOffset.UtcNow;
var orderItems = _orderItemRepository.Query().Include(x => x.Product).Where(x => x.Order.Id == order.Id);
foreach (var item in orderItems)
diff --git a/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs b/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs
index 9e96af7530..fa6b1e8f94 100644
--- a/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs
+++ b/src/Modules/SimplCommerce.Module.Payments/Models/Payment.cs
@@ -9,8 +9,8 @@ public class Payment : EntityBase
{
public Payment()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
public long OrderId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs b/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs
index 2afd5a3347..b7532ec22d 100644
--- a/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs
+++ b/src/Modules/SimplCommerce.Module.Pricing/Models/CartRuleUsage.cs
@@ -8,7 +8,7 @@ public class CartRuleUsage : EntityBase
{
public CartRuleUsage()
{
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
public long CartRuleId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs b/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs
index 88d52b64c3..15e89a3c7f 100644
--- a/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs
+++ b/src/Modules/SimplCommerce.Module.Pricing/Models/Coupon.cs
@@ -8,7 +8,7 @@ public class Coupon : EntityBase
{
public Coupon ()
{
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
public long CartRuleId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs b/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs
index e0a0e7b91f..c5dcf7ba60 100644
--- a/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs
+++ b/src/Modules/SimplCommerce.Module.Pricing/Services/CouponService.cs
@@ -37,13 +37,13 @@ public async Task Validate(long customerId, string coupo
return validationResult;
}
- if (coupon.CartRule.StartOn.HasValue && coupon.CartRule.StartOn > DateTimeOffset.Now)
+ if (coupon.CartRule.StartOn.HasValue && coupon.CartRule.StartOn > DateTimeOffset.UtcNow)
{
validationResult.ErrorMessage = $"The coupon {couponCode} should be used after {coupon.CartRule.StartOn}.";
return validationResult;
}
- if (coupon.CartRule.EndOn.HasValue && coupon.CartRule.EndOn <= DateTimeOffset.Now)
+ if (coupon.CartRule.EndOn.HasValue && coupon.CartRule.EndOn <= DateTimeOffset.UtcNow)
{
validationResult.ErrorMessage = $"The coupon {couponCode} is expired.";
return validationResult;
diff --git a/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs b/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs
index bfd95a82d2..d5191d5919 100644
--- a/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs
+++ b/src/Modules/SimplCommerce.Module.ProductComparison/Services/ComparingProductService.cs
@@ -30,7 +30,7 @@ public void AddToComparison(long userId, long productId)
{
UserId = userId,
ProductId = productId,
- CreatedOn = DateTimeOffset.Now
+ CreatedOn = DateTimeOffset.UtcNow
};
_comparingProductRepository.Add(comparingProduct);
diff --git a/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs b/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs
index 0d408af6f7..e0891b82ba 100644
--- a/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs
+++ b/src/Modules/SimplCommerce.Module.ProductRecentlyViewed/Events/EntityViewedHandler.cs
@@ -37,13 +37,13 @@ public async Task Handle(EntityViewed notification, CancellationToken cancellati
{
UserId = user.Id,
ProductId = notification.EntityId,
- LatestViewedOn = DateTimeOffset.Now
+ LatestViewedOn = DateTimeOffset.UtcNow
};
_recentlyViewedProductRepository.Add(recentlyViewedProduct);
}
- recentlyViewedProduct.LatestViewedOn = DateTimeOffset.Now;
+ recentlyViewedProduct.LatestViewedOn = DateTimeOffset.UtcNow;
_recentlyViewedProductRepository.SaveChanges();
}
}
diff --git a/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs b/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs
index ae2c62db38..76e59fd507 100644
--- a/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs
+++ b/src/Modules/SimplCommerce.Module.Reviews/Models/Reply.cs
@@ -10,7 +10,7 @@ public class Reply : EntityBase
public Reply()
{
Status = ReplyStatus.Pending;
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
public long ReviewId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs b/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs
index 2bc1d9991a..55a84ff15c 100644
--- a/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs
+++ b/src/Modules/SimplCommerce.Module.Reviews/Models/Review.cs
@@ -11,7 +11,7 @@ public class Review : EntityBase
public Review()
{
Status = ReviewStatus.Pending;
- CreatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
}
public long UserId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs b/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs
index cdcd54d672..3bea4e6d40 100644
--- a/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs
+++ b/src/Modules/SimplCommerce.Module.Search/Areas/Search/Controllers/SearchController.cs
@@ -198,7 +198,7 @@ private void SaveSearchQuery(SearchOption searchOption, SearchResult model)
{
var query = new Query
{
- CreatedOn = DateTimeOffset.Now,
+ CreatedOn = DateTimeOffset.UtcNow,
QueryText = searchOption.Query,
ResultsCount = model.TotalProduct
};
diff --git a/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs b/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs
index f853eaeffe..2c68a42616 100644
--- a/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs
+++ b/src/Modules/SimplCommerce.Module.Shipments/Areas/Shipments/Controllers/ShipmentApiController.cs
@@ -209,8 +209,8 @@ public async Task Post([FromBody] ShipmentForm model)
WarehouseId = model.WarehouseId,
CreatedById = currentUser.Id,
TrackingNumber = model.TrackingNumber,
- CreatedOn = DateTimeOffset.Now,
- LatestUpdatedOn = DateTimeOffset.Now
+ CreatedOn = DateTimeOffset.UtcNow,
+ LatestUpdatedOn = DateTimeOffset.UtcNow
};
if (!User.IsInRole("admin"))
diff --git a/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs b/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs
index 21b4995da3..4537a5a96d 100644
--- a/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs
+++ b/src/Modules/SimplCommerce.Module.Shipments/Models/Shipment.cs
@@ -12,8 +12,8 @@ public class Shipment : EntityBase
{
public Shipment()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
public long OrderId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs b/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs
index 35f8d2a1a7..c2bc7a020a 100644
--- a/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs
+++ b/src/Modules/SimplCommerce.Module.ShoppingCart/Models/Cart.cs
@@ -10,8 +10,8 @@ public class Cart : EntityBase
{
public Cart()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
IsActive = true;
}
diff --git a/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs b/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs
index 988fd1d5c9..b4043fe868 100644
--- a/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs
+++ b/src/Modules/SimplCommerce.Module.ShoppingCart/Services/CartService.cs
@@ -99,7 +99,7 @@ public async Task AddToCart(long customerId, long createdById,
Cart = cart,
ProductId = productId,
Quantity = quantity,
- CreatedOn = DateTimeOffset.Now
+ CreatedOn = DateTimeOffset.UtcNow
};
cart.Items.Add(cartItem);
@@ -227,7 +227,7 @@ public async Task MigrateCart(long fromUserId, long toUserId)
Cart = cartTo,
ProductId = fromItem.ProductId,
Quantity = fromItem.Quantity,
- CreatedOn = DateTimeOffset.Now
+ CreatedOn = DateTimeOffset.UtcNow
};
cartTo.Items.Add(toItem);
}
diff --git a/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs b/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs
index 5f73a68feb..e978376b8e 100644
--- a/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs
+++ b/src/Modules/SimplCommerce.Module.Vendors/Areas/Vendors/Controllers/VendorApiController.cs
@@ -140,7 +140,7 @@ public async Task Put(long id, [FromBody] VendorForm model)
vendor.Email = model.Email;
vendor.Description = model.Description;
vendor.IsActive = model.IsActive;
- vendor.LatestUpdatedOn = DateTimeOffset.Now;
+ vendor.LatestUpdatedOn = DateTimeOffset.UtcNow;
await _vendorService.Update(vendor);
return Accepted();
diff --git a/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs b/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs
index acab43bc1e..ad119ba1fb 100644
--- a/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs
+++ b/src/Modules/SimplCommerce.Module.WishList/Areas/WishList/Controllers/WishListController.cs
@@ -235,7 +235,7 @@ public async Task AddItem([FromBody] AddToWishList model)
_wishListItemRepository.Add(wishListItem);
- wishList.LatestUpdatedOn = DateTimeOffset.Now;
+ wishList.LatestUpdatedOn = DateTimeOffset.UtcNow;
await _wishListRepository.SaveChangesAsync();
resultModel.Message = "The product has been added to your wish list";
@@ -282,7 +282,7 @@ public async Task RemoveItem(long id)
_wishListItemRepository.Remove(wishListItem);
- wishList.LatestUpdatedOn = DateTimeOffset.Now;
+ wishList.LatestUpdatedOn = DateTimeOffset.UtcNow;
await _wishListRepository.SaveChangesAsync();
return Ok();
@@ -317,9 +317,9 @@ public async Task UpdateItem([FromBody] UpdateWishListItem model)
wishListItem.Description = String.IsNullOrWhiteSpace(model.Description) ? null : model.Description;
wishListItem.Quantity = model.Quantity;
- wishListItem.LatestUpdatedOn = DateTimeOffset.Now;
+ wishListItem.LatestUpdatedOn = DateTimeOffset.UtcNow;
- wishList.LatestUpdatedOn = DateTimeOffset.Now;
+ wishList.LatestUpdatedOn = DateTimeOffset.UtcNow;
await _wishListRepository.SaveChangesAsync();
return PartialView("UpdateItemResult");
diff --git a/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs b/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs
index beca10e360..25ca5ba763 100644
--- a/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs
+++ b/src/Modules/SimplCommerce.Module.WishList/Models/WishList.cs
@@ -10,8 +10,8 @@ public class WishList : EntityBase
{
public WishList()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
public long UserId { get; set; }
diff --git a/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs b/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs
index ae844ac301..a3124c7cf4 100644
--- a/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs
+++ b/src/Modules/SimplCommerce.Module.WishList/Models/WishListItem.cs
@@ -8,8 +8,8 @@ public class WishListItem : EntityBase
{
public WishListItem()
{
- CreatedOn = DateTimeOffset.Now;
- LatestUpdatedOn = DateTimeOffset.Now;
+ CreatedOn = DateTimeOffset.UtcNow;
+ LatestUpdatedOn = DateTimeOffset.UtcNow;
}
public long WishListId { get; set; }
diff --git a/src/SimplCommerce.Db.MsSql/DependencyInjection.cs b/src/SimplCommerce.Db.MsSql/DependencyInjection.cs
new file mode 100644
index 0000000000..96a12cd8e6
--- /dev/null
+++ b/src/SimplCommerce.Db.MsSql/DependencyInjection.cs
@@ -0,0 +1,22 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using SimplCommerce.Module.Core.Data;
+using SimplCommerce.Module.Core.Extensions;
+
+namespace SimplCommerce.Db.MsSql
+{
+ public static class DependencyInjection
+ {
+ public static IServiceCollection AddDbConfiguration(this IServiceCollection services, string connectionString)
+ {
+ services.AddDbContextPool(options =>
+ options.UseSqlServer(connectionString,
+ x => x.MigrationsAssembly(
+ typeof(DependencyInjection).Assembly.FullName)
+ ));
+ return services;
+ }
+ }
+}
diff --git a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs
index 13c22acee4..0e8ebb496c 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190212090153_SimplCommerce_v1_0_0")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.cs
index 572ca3f207..62481ae9fb 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190212090153_SimplCommerce_v1_0_0.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190212090153_SimplCommerce_v1_0_0.cs
@@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class SimplCommerce_v1_0_0 : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs
index e3186988ef..8d731a9641 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190224050227_AddedCartLockOnCheckout")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.cs
similarity index 93%
rename from src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.cs
index 85c972d2b8..f7ebd7a7ec 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190224050227_AddedCartLockOnCheckout.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190224050227_AddedCartLockOnCheckout.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class AddedCartLockOnCheckout : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.Designer.cs
index 1ff5880623..440d18626d 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190302122027_MomoPayment")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.cs
similarity index 95%
rename from src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.cs
index 15f0c73aa4..2616bc01ff 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190302122027_MomoPayment.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190302122027_MomoPayment.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class MomoPayment : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs
index 15a34673cb..5659dedf2e 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190314044223_AddedNganLuongPayment")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.cs
similarity index 95%
rename from src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.cs
index 5513b4e818..44ddc4092a 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190314044223_AddedNganLuongPayment.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190314044223_AddedNganLuongPayment.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class AddedNganLuongPayment : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs
index 06651706a5..1bb3aa047d 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190710165614_DefaultCultureConfiguration")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.cs
similarity index 94%
rename from src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.cs
index a457e41c60..137b5cf257 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190710165614_DefaultCultureConfiguration.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190710165614_DefaultCultureConfiguration.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class DefaultCultureConfiguration : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.Designer.cs
index 75cfb8d5de..4f20666ce3 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190726221912_AddedCurrencySetting")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.cs
similarity index 97%
rename from src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.cs
index 2229c8af6c..dfbc5ffb75 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190726221912_AddedCurrencySetting.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190726221912_AddedCurrencySetting.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class AddedCurrencySetting : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.Designer.cs
index 77e9fc7d54..1b16683a57 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190727083300_AddedContentLocalization")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.cs
similarity index 98%
rename from src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.cs
index 283edaca43..9c15f2986a 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190727083300_AddedContentLocalization.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190727083300_AddedContentLocalization.cs
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class AddedContentLocalization : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.Designer.cs
index 6811cfcef2..0b387dbc97 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190801065533_AddedCashfreePayment")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.cs
similarity index 95%
rename from src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.cs
index 47a58a8057..8249b1ca13 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190801065533_AddedCashfreePayment.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190801065533_AddedCashfreePayment.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class AddedCashfreePayment : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs
index 4f485d4b8c..6ec2d40991 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.Designer.cs
@@ -7,7 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
[Migration("20190803175214_AddedAssetBundlingConfig")]
diff --git a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.cs b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.cs
similarity index 94%
rename from src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.cs
index f95b94de04..93b7cdf6cc 100644
--- a/src/SimplCommerce.WebHost/Migrations/20190803175214_AddedAssetBundlingConfig.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/20190803175214_AddedAssetBundlingConfig.cs
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class AddedAssetBundlingConfig : Migration
{
diff --git a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs b/src/SimplCommerce.Db.MsSql/Migrations/SimplDbContextModelSnapshot.cs
similarity index 99%
rename from src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs
rename to src/SimplCommerce.Db.MsSql/Migrations/SimplDbContextModelSnapshot.cs
index 21da213780..3f59aeaa25 100644
--- a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs
+++ b/src/SimplCommerce.Db.MsSql/Migrations/SimplDbContextModelSnapshot.cs
@@ -6,7 +6,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimplCommerce.Module.Core.Data;
-namespace SimplCommerce.WebHost.Migrations
+namespace SimplCommerce.Db.MsSql.Migrations
{
[DbContext(typeof(SimplDbContext))]
partial class SimplDbContextModelSnapshot : ModelSnapshot
diff --git a/src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj b/src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj
new file mode 100644
index 0000000000..17891d99b3
--- /dev/null
+++ b/src/SimplCommerce.Db.MsSql/SimplCommerce.Db.MsSql.csproj
@@ -0,0 +1,21 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
diff --git a/src/SimplCommerce.Db.PgSql/DependencyInjection.cs b/src/SimplCommerce.Db.PgSql/DependencyInjection.cs
new file mode 100644
index 0000000000..c7890f13db
--- /dev/null
+++ b/src/SimplCommerce.Db.PgSql/DependencyInjection.cs
@@ -0,0 +1,22 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using SimplCommerce.Module.Core.Data;
+using SimplCommerce.Module.Core.Extensions;
+
+namespace SimplCommerce.Db.PgSql
+{
+ public static class DependencyInjection
+ {
+ public static IServiceCollection AddDbConfiguration(this IServiceCollection services, string connectionString)
+ {
+ services.AddDbContextPool(options =>
+ options.UseNpgsql(connectionString,
+ x => x.MigrationsAssembly(
+ typeof(DependencyInjection).Assembly.FullName)
+ ));
+ return services;
+ }
+ }
+}
diff --git a/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.Designer.cs b/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.Designer.cs
new file mode 100644
index 0000000000..eefadb5e90
--- /dev/null
+++ b/src/SimplCommerce.Db.PgSql/Migrations/20220508115122_Initial.Designer.cs
@@ -0,0 +1,4689 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using SimplCommerce.Module.Core.Data;
+
+#nullable disable
+
+namespace SimplCommerce.Db.PgSql.Migrations
+{
+ [DbContext(typeof(SimplDbContext))]
+ [Migration("20220508115122_Initial")]
+ partial class Initial
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "6.0.4")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("Core_RoleClaim", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Core_UserClaim", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property("ProviderKey")
+ .HasColumnType("text");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Core_UserLogin", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.Property("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("Core_UserToken", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Localization_Culture", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = "en-US",
+ Name = "English (US)"
+ });
+ });
+
+ modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CultureId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("EntityId")
+ .HasColumnType("bigint");
+
+ b.Property("EntityType")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("ProperyName")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CultureId");
+
+ b.ToTable("Localization_LocalizedContentProperty", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CultureId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CultureId");
+
+ b.ToTable("Localization_Resource", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ActivityTypeId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("EntityId")
+ .HasColumnType("bigint");
+
+ b.Property("EntityTypeId")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ActivityTypeId");
+
+ b.ToTable("ActivityLog_Activity", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.ActivityType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("ActivityLog_ActivityType", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = 1L,
+ Name = "EntityView"
+ });
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Brand", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("IsPublished")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Catalog_Brand", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IncludeInMenu")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("IsPublished")
+ .HasColumnType("boolean");
+
+ b.Property("MetaDescription")
+ .HasColumnType("text");
+
+ b.Property("MetaKeywords")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("MetaTitle")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("ParentId")
+ .HasColumnType("bigint");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("ThumbnailImageId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.HasIndex("ThumbnailImageId");
+
+ b.ToTable("Catalog_Category", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("BrandId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedById")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("Gtin")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("HasOptions")
+ .HasColumnType("boolean");
+
+ b.Property("IsAllowToOrder")
+ .HasColumnType("boolean");
+
+ b.Property("IsCallForPricing")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("IsFeatured")
+ .HasColumnType("boolean");
+
+ b.Property("IsPublished")
+ .HasColumnType("boolean");
+
+ b.Property("IsVisibleIndividually")
+ .HasColumnType("boolean");
+
+ b.Property("LatestUpdatedById")
+ .HasColumnType("bigint");
+
+ b.Property("LatestUpdatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("MetaDescription")
+ .HasColumnType("text");
+
+ b.Property("MetaKeywords")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("MetaTitle")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("OldPrice")
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("Price")
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("PublishedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RatingAverage")
+ .HasColumnType("double precision");
+
+ b.Property("ReviewsCount")
+ .HasColumnType("integer");
+
+ b.Property("ShortDescription")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Sku")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("SpecialPrice")
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("SpecialPriceEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SpecialPriceStart")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Specification")
+ .HasColumnType("text");
+
+ b.Property("StockQuantity")
+ .HasColumnType("integer");
+
+ b.Property("StockTrackingIsEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("TaxClassId")
+ .HasColumnType("bigint");
+
+ b.Property("ThumbnailImageId")
+ .HasColumnType("bigint");
+
+ b.Property("VendorId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BrandId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("LatestUpdatedById");
+
+ b.HasIndex("TaxClassId");
+
+ b.HasIndex("ThumbnailImageId");
+
+ b.ToTable("Catalog_Product", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("GroupId");
+
+ b.ToTable("Catalog_ProductAttribute", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Catalog_ProductAttributeGroup", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AttributeId")
+ .HasColumnType("bigint");
+
+ b.Property("ProductId")
+ .HasColumnType("bigint");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AttributeId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Catalog_ProductAttributeValue", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CategoryId")
+ .HasColumnType("bigint");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsFeaturedProduct")
+ .HasColumnType("boolean");
+
+ b.Property("ProductId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CategoryId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Catalog_ProductCategory", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("LinkType")
+ .HasColumnType("integer");
+
+ b.Property("LinkedProductId")
+ .HasColumnType("bigint");
+
+ b.Property("ProductId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LinkedProductId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Catalog_ProductLink", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("MediaId")
+ .HasColumnType("bigint");
+
+ b.Property("ProductId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MediaId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Catalog_ProductMedia", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOption", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Catalog_ProductOption", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = 1L,
+ Name = "Color"
+ },
+ new
+ {
+ Id = 2L,
+ Name = "Size"
+ });
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("OptionId")
+ .HasColumnType("bigint");
+
+ b.Property("ProductId")
+ .HasColumnType("bigint");
+
+ b.Property("SortIndex")
+ .HasColumnType("integer");
+
+ b.Property("Value")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OptionId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Catalog_ProductOptionCombination", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DisplayType")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("OptionId")
+ .HasColumnType("bigint");
+
+ b.Property("ProductId")
+ .HasColumnType("bigint");
+
+ b.Property("SortIndex")
+ .HasColumnType("integer");
+
+ b.Property("Value")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OptionId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Catalog_ProductOptionValue", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedById")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("OldPrice")
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("Price")
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("ProductId")
+ .HasColumnType("bigint");
+
+ b.Property("SpecialPrice")
+ .HasColumnType("numeric(18,2)");
+
+ b.Property("SpecialPriceEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SpecialPriceStart")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Catalog_ProductPriceHistory", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Catalog_ProductTemplate", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b =>
+ {
+ b.Property("ProductTemplateId")
+ .HasColumnType("bigint");
+
+ b.Property("ProductAttributeId")
+ .HasColumnType("bigint");
+
+ b.HasKey("ProductTemplateId", "ProductAttributeId");
+
+ b.HasIndex("ProductAttributeId");
+
+ b.ToTable("Catalog_ProductTemplateProductAttribute", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("IsPublished")
+ .HasColumnType("boolean");
+
+ b.Property("IsSystem")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Cms_Menu", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = 1L,
+ IsPublished = true,
+ IsSystem = true,
+ Name = "Customer Services"
+ },
+ new
+ {
+ Id = 2L,
+ IsPublished = true,
+ IsSystem = true,
+ Name = "Information"
+ });
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CustomLink")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("EntityId")
+ .HasColumnType("bigint");
+
+ b.Property("MenuId")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("ParentId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId");
+
+ b.HasIndex("MenuId");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("Cms_MenuItem", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Body")
+ .HasColumnType("text");
+
+ b.Property("CreatedById")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("IsPublished")
+ .HasColumnType("boolean");
+
+ b.Property("LatestUpdatedById")
+ .HasColumnType("bigint");
+
+ b.Property("LatestUpdatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("MetaDescription")
+ .HasColumnType("text");
+
+ b.Property("MetaKeywords")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("MetaTitle")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("PublishedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("LatestUpdatedById");
+
+ b.ToTable("Cms_Page", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CommentText")
+ .HasColumnType("text");
+
+ b.Property("CommenterName")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("EntityId")
+ .HasColumnType("bigint");
+
+ b.Property("EntityTypeId")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("ParentId")
+ .HasColumnType("bigint");
+
+ b.Property("Status")
+ .HasColumnType("integer");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Comments_Comment", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Address")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("ContactAreaId")
+ .HasColumnType("bigint");
+
+ b.Property("Content")
+ .HasColumnType("text");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("EmailAddress")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("FullName")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("PhoneNumber")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContactAreaId");
+
+ b.ToTable("Contacts_Contact", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.ContactArea", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Contacts_ContactArea", (string)null);
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AddressLine1")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("AddressLine2")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("City")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("ContactName")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("CountryId")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("DistrictId")
+ .HasColumnType("bigint");
+
+ b.Property("Phone")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("StateOrProvinceId")
+ .HasColumnType("bigint");
+
+ b.Property("ZipCode")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CountryId");
+
+ b.HasIndex("DistrictId");
+
+ b.HasIndex("StateOrProvinceId");
+
+ b.ToTable("Core_Address", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = 1L,
+ AddressLine1 = "364 Cong Hoa",
+ ContactName = "Thien Nguyen",
+ CountryId = "VN",
+ StateOrProvinceId = 1L
+ });
+ });
+
+ modelBuilder.Entity("SimplCommerce.Module.Core.Models.AppSetting", b =>
+ {
+ b.Property