diff --git a/Masa.Framework.sln b/Masa.Framework.sln
index d939f86d1..aadb4b9e3 100644
--- a/Masa.Framework.sln
+++ b/Masa.Framework.sln
@@ -17,10 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
LICENSE.txt = LICENSE.txt
+ Masa.Framework.sln.DotSettings = Masa.Framework.sln.DotSettings
NuGet.Config = NuGet.Config
README.md = README.md
README.zh-CN.md = README.zh-CN.md
- Masa.Framework.sln.DotSettings = Masa.Framework.sln.DotSettings
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E747043D-81E2-4A89-8B5B-1258ED45F941}"
@@ -131,8 +131,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentic
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Utils\Caching\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{015C4181-A8D9-4FA5-89B9-38A37FA9D31D}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Utils\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{7B0EDB07-D3AE-4077-9A23-35CA6556E791}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Utils\Configuration\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Utils\Data\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{766E3633-7B82-49CC-B012-CAE6264D4628}"
@@ -555,6 +553,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentic
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Authentication.OpenIdConnect", "src\Contrib\Service\Caller\Authentication\Masa.Contrib.Service.Caller.Authentication.OpenIdConnect\Masa.Contrib.Service.Caller.Authentication.OpenIdConnect.csproj", "{9BB5CC86-C2E8-4859-9610-50DB263605A3}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Globalization", "Globalization", "{D10FC534-0091-42B4-809F-82C1E2164ED5}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Globalization", "Globalization", "{5B129E6F-8CB7-4E2E-9F3E-C59CF22C9CA9}"
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8D7D3D21-86DB-4FCC-8FF0-6E1587ABD22A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Authentication.OpenIdConnect.Tests", "src\Contrib\Service\Caller\Authentication\Tests\Masa.Contrib.Service.Caller.Authentication.OpenIdConnect.Tests\Masa.Contrib.Service.Caller.Authentication.OpenIdConnect.Tests.csproj", "{BEA8E5A5-E7BD-4165-80CD-D1F53ED82D02}"
@@ -571,31 +573,55 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.RulesEn
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{43E0F1C0-7308-45C9-83CF-E6291ACE9F0F}"
EndProject
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Development.DaprStarter", "src\BuildingBlocks\Development\Masa.BuildingBlocks.Development.DaprStarter\Masa.BuildingBlocks.Development.DaprStarter.csproj", "{77A9CADA-35D6-419B-87B3-AACC50FFAD0F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Development.DaprStarter", "src\BuildingBlocks\Development\Masa.BuildingBlocks.Development.DaprStarter\Masa.BuildingBlocks.Development.DaprStarter.csproj", "{77A9CADA-35D6-419B-87B3-AACC50FFAD0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.RulesEngine.MicrosoftRulesEngine", "src\Contrib\RulesEngine\Masa.Contrib.RulesEngine.MicrosoftRulesEngine\Masa.Contrib.RulesEngine.MicrosoftRulesEngine.csproj", "{4E217EC9-0616-414B-82D9-9107F9826D6E}"
EndProject
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Development.DaprStarter", "src\Contrib\Development\Masa.Contrib.Development.DaprStarter\Masa.Contrib.Development.DaprStarter.csproj", "{A6D4C293-E184-42C0-B9B7-3F856BE57EC0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Development.DaprStarter", "src\Contrib\Development\Masa.Contrib.Development.DaprStarter\Masa.Contrib.Development.DaprStarter.csproj", "{A6D4C293-E184-42C0-B9B7-3F856BE57EC0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{3FADF704-2581-47AC-A1F7-07091B6328A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.RulesEngine.MicrosoftRulesEngine.Tests", "src\Contrib\RulesEngine\Tests\Masa.Contrib.RulesEngine.MicrosoftRulesEngine.Tests\Masa.Contrib.RulesEngine.MicrosoftRulesEngine.Tests.csproj", "{EEB2D542-5A2C-4E18-A0E6-72844C359DAD}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Development.DaprStarter.AspNetCore", "src\Contrib\Development\Masa.Contrib.Development.DaprStarter.AspNetCore\Masa.Contrib.Development.DaprStarter.AspNetCore.csproj", "{E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Development.DaprStarter.AspNetCore", "src\Contrib\Development\Masa.Contrib.Development.DaprStarter.AspNetCore\Masa.Contrib.Development.DaprStarter.AspNetCore.csproj", "{E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dcc", "Dcc", "{5E0E61DA-06FF-4F08-9C76-0A8856C90EF5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\BuildingBlocks\StackSdks\Dcc\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{356C5F47-025F-4ED6-8E8A-8745E181C455}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.StackSdks.Dcc.Contracts", "src\BuildingBlocks\StackSdks\Dcc\Masa.BuildingBlocks.StackSdks.Dcc.Contracts\Masa.BuildingBlocks.StackSdks.Dcc.Contracts.csproj", "{C2E9EDAE-2558-4899-A486-917AE7A5D24F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc.Contracts", "src\BuildingBlocks\StackSdks\Dcc\Masa.BuildingBlocks.StackSdks.Dcc.Contracts\Masa.BuildingBlocks.StackSdks.Dcc.Contracts.csproj", "{C2E9EDAE-2558-4899-A486-917AE7A5D24F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8CDAF37E-3DB1-4573-B5AA-376C93A8D299}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Development.DaprStarter.Tests", "src\Contrib\Development\Tests\Masa.Contrib.Development.DaprStarter.Tests\Masa.Contrib.Development.DaprStarter.Tests.csproj", "{49B51B95-3DC5-45BD-B91A-3056FF5014B5}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Development.DaprStarter.Tests", "src\Contrib\Development\Tests\Masa.Contrib.Development.DaprStarter.Tests\Masa.Contrib.Development.DaprStarter.Tests.csproj", "{49B51B95-3DC5-45BD-B91A-3056FF5014B5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Development.DaprStarter.AspNetCore.Tests", "src\Contrib\Development\Tests\Masa.Contrib.Development.DaprStarter.AspNetCore.Tests\Masa.Contrib.Development.DaprStarter.AspNetCore.Tests.csproj", "{DD899DC4-A2B7-4C7B-A644-EDB56A61145C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Globalization.I18n", "src\Contrib\Globalization\Masa.Contrib.Globalization.I18n\Masa.Contrib.Globalization.I18n.csproj", "{F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D2E598D5-5E44-4275-AF03-4BAD07A0E13B}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Globalization.I18n.Tests", "src\Contrib\Globalization\Tests\Masa.Contrib.Globalization.I18n.Tests\Masa.Contrib.Globalization.I18n.Tests.csproj", "{6C732EBE-22CC-4160-B427-F4558C899024}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Globalization.I18n.Dcc", "src\Contrib\Globalization\Masa.Contrib.Globalization.I18n.Dcc\Masa.Contrib.Globalization.I18n.Dcc.csproj", "{B0EFDF9E-81FF-4880-992B-8A65A2008717}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Globalization.I18n.Dcc.Tests", "src\Contrib\Globalization\Tests\Masa.Contrib.Globalization.I18n.Dcc.Tests\Masa.Contrib.Globalization.I18n.Dcc.Tests.csproj", "{91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exception", "Exception", "{84F366D3-6E9A-4101-AEC0-287CBA6984A8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exception", "Exception", "{F17FFB29-A622-4430-B2EA-E9FF20E68122}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Exceptions", "src\BuildingBlocks\Exception\Masa.BuildingBlocks.Exceptions\Masa.BuildingBlocks.Exceptions.csproj", "{145400E0-7AC3-4D7B-88D1-F17847E4FA6D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Exceptions", "src\Contrib\Exception\Masa.Contrib.Exceptions\Masa.Contrib.Exceptions.csproj", "{C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Exceptions.Tests", "src\BuildingBlocks\Exception\Masa.BuildingBlocks.Exceptions.Tests\Masa.BuildingBlocks.Exceptions.Tests.csproj", "{921DCAAC-3146-4EDB-891C-D76089E4A451}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Globalization.I18n.AspNetCore", "src\Contrib\Globalization\Masa.Contrib.Globalization.I18n.AspNetCore\Masa.Contrib.Globalization.I18n.AspNetCore.csproj", "{B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Dispatcher.Events.FluentValidation", "src\Contrib\Dispatcher\Masa.Contrib.Dispatcher.Events.FluentValidation\Masa.Contrib.Dispatcher.Events.FluentValidation.csproj", "{66B1723A-D578-418C-B21C-2C3B5CBD1180}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Development.DaprStarter.AspNetCore.Tests", "src\Contrib\Development\Tests\Masa.Contrib.Development.DaprStarter.AspNetCore.Tests\Masa.Contrib.Development.DaprStarter.AspNetCore.Tests.csproj", "{DD899DC4-A2B7-4C7B-A644-EDB56A61145C}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Globalization.I18n", "src\BuildingBlocks\Globalization\Masa.BuildingBlocks.Globalization.I18n\Masa.BuildingBlocks.Globalization.I18n.csproj", "{6088C3D3-E17E-41BC-A21F-F222F5123DF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -845,14 +871,6 @@ Global
{015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Release|Any CPU.Build.0 = Release|Any CPU
{015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Release|x64.ActiveCfg = Release|Any CPU
{015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Release|x64.Build.0 = Release|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|x64.ActiveCfg = Debug|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|x64.Build.0 = Debug|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|Any CPU.Build.0 = Release|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|x64.ActiveCfg = Release|Any CPU
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|x64.Build.0 = Release|Any CPU
{8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -2029,6 +2047,14 @@ Global
{B03C329C-70F4-442A-B420-90DDF7E31847}.Release|Any CPU.Build.0 = Release|Any CPU
{B03C329C-70F4-442A-B420-90DDF7E31847}.Release|x64.ActiveCfg = Release|Any CPU
{B03C329C-70F4-442A-B420-90DDF7E31847}.Release|x64.Build.0 = Release|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|x64.Build.0 = Debug|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|x64.ActiveCfg = Release|Any CPU
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|x64.Build.0 = Release|Any CPU
{4E217EC9-0616-414B-82D9-9107F9826D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4E217EC9-0616-414B-82D9-9107F9826D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E217EC9-0616-414B-82D9-9107F9826D6E}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -2037,6 +2063,14 @@ Global
{4E217EC9-0616-414B-82D9-9107F9826D6E}.Release|Any CPU.Build.0 = Release|Any CPU
{4E217EC9-0616-414B-82D9-9107F9826D6E}.Release|x64.ActiveCfg = Release|Any CPU
{4E217EC9-0616-414B-82D9-9107F9826D6E}.Release|x64.Build.0 = Release|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|x64.Build.0 = Debug|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|x64.ActiveCfg = Release|Any CPU
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|x64.Build.0 = Release|Any CPU
{EEB2D542-5A2C-4E18-A0E6-72844C359DAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEB2D542-5A2C-4E18-A0E6-72844C359DAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEB2D542-5A2C-4E18-A0E6-72844C359DAD}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -2045,6 +2079,14 @@ Global
{EEB2D542-5A2C-4E18-A0E6-72844C359DAD}.Release|Any CPU.Build.0 = Release|Any CPU
{EEB2D542-5A2C-4E18-A0E6-72844C359DAD}.Release|x64.ActiveCfg = Release|Any CPU
{EEB2D542-5A2C-4E18-A0E6-72844C359DAD}.Release|x64.Build.0 = Release|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|x64.Build.0 = Debug|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|x64.ActiveCfg = Release|Any CPU
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|x64.Build.0 = Release|Any CPU
{356C5F47-025F-4ED6-8E8A-8745E181C455}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{356C5F47-025F-4ED6-8E8A-8745E181C455}.Debug|Any CPU.Build.0 = Debug|Any CPU
{356C5F47-025F-4ED6-8E8A-8745E181C455}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -2061,30 +2103,6 @@ Global
{C2E9EDAE-2558-4899-A486-917AE7A5D24F}.Release|Any CPU.Build.0 = Release|Any CPU
{C2E9EDAE-2558-4899-A486-917AE7A5D24F}.Release|x64.ActiveCfg = Release|Any CPU
{C2E9EDAE-2558-4899-A486-917AE7A5D24F}.Release|x64.Build.0 = Release|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|x64.ActiveCfg = Debug|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Debug|x64.Build.0 = Debug|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|Any CPU.Build.0 = Release|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|x64.ActiveCfg = Release|Any CPU
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F}.Release|x64.Build.0 = Release|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Debug|x64.Build.0 = Debug|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|Any CPU.Build.0 = Release|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|x64.ActiveCfg = Release|Any CPU
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0}.Release|x64.Build.0 = Release|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|x64.ActiveCfg = Debug|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Debug|x64.Build.0 = Debug|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|Any CPU.Build.0 = Release|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|x64.ActiveCfg = Release|Any CPU
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA}.Release|x64.Build.0 = Release|Any CPU
{49B51B95-3DC5-45BD-B91A-3056FF5014B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49B51B95-3DC5-45BD-B91A-3056FF5014B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49B51B95-3DC5-45BD-B91A-3056FF5014B5}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -2101,6 +2119,86 @@ Global
{DD899DC4-A2B7-4C7B-A644-EDB56A61145C}.Release|Any CPU.Build.0 = Release|Any CPU
{DD899DC4-A2B7-4C7B-A644-EDB56A61145C}.Release|x64.ActiveCfg = Release|Any CPU
{DD899DC4-A2B7-4C7B-A644-EDB56A61145C}.Release|x64.Build.0 = Release|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Debug|x64.Build.0 = Debug|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Release|x64.ActiveCfg = Release|Any CPU
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B}.Release|x64.Build.0 = Release|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Debug|x64.Build.0 = Debug|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Release|x64.ActiveCfg = Release|Any CPU
+ {6C732EBE-22CC-4160-B427-F4558C899024}.Release|x64.Build.0 = Release|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Debug|x64.Build.0 = Debug|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Release|x64.ActiveCfg = Release|Any CPU
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717}.Release|x64.Build.0 = Release|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Debug|x64.Build.0 = Debug|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Release|Any CPU.Build.0 = Release|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Release|x64.ActiveCfg = Release|Any CPU
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52}.Release|x64.Build.0 = Release|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Debug|x64.Build.0 = Debug|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Release|x64.ActiveCfg = Release|Any CPU
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D}.Release|x64.Build.0 = Release|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Debug|x64.Build.0 = Debug|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Release|x64.ActiveCfg = Release|Any CPU
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48}.Release|x64.Build.0 = Release|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Debug|x64.Build.0 = Debug|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Release|Any CPU.Build.0 = Release|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Release|x64.ActiveCfg = Release|Any CPU
+ {921DCAAC-3146-4EDB-891C-D76089E4A451}.Release|x64.Build.0 = Release|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Debug|x64.Build.0 = Debug|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Release|x64.ActiveCfg = Release|Any CPU
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4}.Release|x64.Build.0 = Release|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Debug|x64.Build.0 = Debug|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Release|Any CPU.Build.0 = Release|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Release|x64.ActiveCfg = Release|Any CPU
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180}.Release|x64.Build.0 = Release|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Debug|x64.Build.0 = Debug|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Release|x64.ActiveCfg = Release|Any CPU
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2162,7 +2260,6 @@ Global
{2D07F9AD-9951-475D-B7C7-980B23FDE9BB} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648}
{534346EF-1D11-48DB-9909-700CEC99FF08} = {2D07F9AD-9951-475D-B7C7-980B23FDE9BB}
{015C4181-A8D9-4FA5-89B9-38A37FA9D31D} = {AF921AB1-64D1-4478-AB49-192F3EE416FC}
- {7B0EDB07-D3AE-4077-9A23-35CA6556E791} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648}
{8AB652AF-3957-42F9-8F3E-FAFE56A44BE1} = {56917740-626B-42D5-8BB8-6895F79FB7D2}
{766E3633-7B82-49CC-B012-CAE6264D4628} = {706DA866-6226-430F-AB4D-98FEE7B0DDB0}
{B7003322-212E-4568-9B61-95DB67CABC3F} = {706DA866-6226-430F-AB4D-98FEE7B0DDB0}
@@ -2374,26 +2471,41 @@ Global
{0FA5E9F9-F2D0-46A3-8EA0-809B219B88E8} = {59BC0E0F-ECEF-4D40-81EC-0EE51CCF9070}
{FC4A0C94-47F7-4C9A-A7EC-138DE8EB842D} = {68491FED-7441-4B58-989D-DF6F198FC91A}
{9BB5CC86-C2E8-4859-9610-50DB263605A3} = {FC4A0C94-47F7-4C9A-A7EC-138DE8EB842D}
+ {D10FC534-0091-42B4-809F-82C1E2164ED5} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}
+ {5B129E6F-8CB7-4E2E-9F3E-C59CF22C9CA9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}
{8D7D3D21-86DB-4FCC-8FF0-6E1587ABD22A} = {FC4A0C94-47F7-4C9A-A7EC-138DE8EB842D}
{BEA8E5A5-E7BD-4165-80CD-D1F53ED82D02} = {8D7D3D21-86DB-4FCC-8FF0-6E1587ABD22A}
{03F476EF-022A-4370-B1C3-FEEDE3BB4E7F} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD}
{A7081ADB-DB21-4678-8510-A5367D470743} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}
+ {64E37EF0-0C85-4F02-A430-6D3B1DBF13DF} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}
{8E74F3D4-9387-4F69-9A17-C793CE2CBAA9} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}
{B03C329C-70F4-442A-B420-90DDF7E31847} = {8E74F3D4-9387-4F69-9A17-C793CE2CBAA9}
+ {43E0F1C0-7308-45C9-83CF-E6291ACE9F0F} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}
+ {77A9CADA-35D6-419B-87B3-AACC50FFAD0F} = {43E0F1C0-7308-45C9-83CF-E6291ACE9F0F}
{4E217EC9-0616-414B-82D9-9107F9826D6E} = {A7081ADB-DB21-4678-8510-A5367D470743}
+ {A6D4C293-E184-42C0-B9B7-3F856BE57EC0} = {64E37EF0-0C85-4F02-A430-6D3B1DBF13DF}
{3FADF704-2581-47AC-A1F7-07091B6328A1} = {A7081ADB-DB21-4678-8510-A5367D470743}
{EEB2D542-5A2C-4E18-A0E6-72844C359DAD} = {3FADF704-2581-47AC-A1F7-07091B6328A1}
- {64E37EF0-0C85-4F02-A430-6D3B1DBF13DF} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}
- {43E0F1C0-7308-45C9-83CF-E6291ACE9F0F} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}
- {77A9CADA-35D6-419B-87B3-AACC50FFAD0F} = {43E0F1C0-7308-45C9-83CF-E6291ACE9F0F}
+ {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA} = {64E37EF0-0C85-4F02-A430-6D3B1DBF13DF}
{5E0E61DA-06FF-4F08-9C76-0A8856C90EF5} = {8A9DBB76-6618-4982-87D7-6CBD8375EB15}
{356C5F47-025F-4ED6-8E8A-8745E181C455} = {5E0E61DA-06FF-4F08-9C76-0A8856C90EF5}
{C2E9EDAE-2558-4899-A486-917AE7A5D24F} = {5E0E61DA-06FF-4F08-9C76-0A8856C90EF5}
- {A6D4C293-E184-42C0-B9B7-3F856BE57EC0} = {64E37EF0-0C85-4F02-A430-6D3B1DBF13DF}
- {E47D82C7-7A1C-4BEF-ACA8-43971FD6C6BA} = {64E37EF0-0C85-4F02-A430-6D3B1DBF13DF}
{8CDAF37E-3DB1-4573-B5AA-376C93A8D299} = {64E37EF0-0C85-4F02-A430-6D3B1DBF13DF}
{49B51B95-3DC5-45BD-B91A-3056FF5014B5} = {8CDAF37E-3DB1-4573-B5AA-376C93A8D299}
{DD899DC4-A2B7-4C7B-A644-EDB56A61145C} = {8CDAF37E-3DB1-4573-B5AA-376C93A8D299}
+ {F9E3EBD9-EE96-40F7-BDC7-818B88557D6B} = {5B129E6F-8CB7-4E2E-9F3E-C59CF22C9CA9}
+ {D2E598D5-5E44-4275-AF03-4BAD07A0E13B} = {5B129E6F-8CB7-4E2E-9F3E-C59CF22C9CA9}
+ {6C732EBE-22CC-4160-B427-F4558C899024} = {D2E598D5-5E44-4275-AF03-4BAD07A0E13B}
+ {B0EFDF9E-81FF-4880-992B-8A65A2008717} = {5B129E6F-8CB7-4E2E-9F3E-C59CF22C9CA9}
+ {91FE0D47-D6DB-4D2D-8C6F-15FCE974AB52} = {D2E598D5-5E44-4275-AF03-4BAD07A0E13B}
+ {84F366D3-6E9A-4101-AEC0-287CBA6984A8} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}
+ {F17FFB29-A622-4430-B2EA-E9FF20E68122} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}
+ {145400E0-7AC3-4D7B-88D1-F17847E4FA6D} = {84F366D3-6E9A-4101-AEC0-287CBA6984A8}
+ {C99BD51C-A9B8-44FE-BB60-6FCC43E9DA48} = {F17FFB29-A622-4430-B2EA-E9FF20E68122}
+ {921DCAAC-3146-4EDB-891C-D76089E4A451} = {84F366D3-6E9A-4101-AEC0-287CBA6984A8}
+ {B7AEC624-6A40-42E7-BDB5-4487ACE48CE4} = {5B129E6F-8CB7-4E2E-9F3E-C59CF22C9CA9}
+ {66B1723A-D578-418C-B21C-2C3B5CBD1180} = {5BE84027-D1B4-4264-A7EC-E84658350CA7}
+ {6088C3D3-E17E-41BC-A21F-F222F5123DF1} = {D10FC534-0091-42B4-809F-82C1E2164ED5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03}
diff --git a/Masa.Framework.sln.DotSettings b/Masa.Framework.sln.DotSettings
index ef0a25952..1e0e7b13e 100644
--- a/Masa.Framework.sln.DotSettings
+++ b/Masa.Framework.sln.DotSettings
@@ -1,4 +1,5 @@
True
True
+ True
True
\ No newline at end of file
diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Extensions/ConfigurationExtensions.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Extensions/ConfigurationExtensions.cs
new file mode 100644
index 000000000..49e8f9c03
--- /dev/null
+++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Extensions/ConfigurationExtensions.cs
@@ -0,0 +1,42 @@
+// Copyright (c) MASA Stack All rights reserved.
+// Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+
+// ReSharper disable once CheckNamespace
+
+namespace Microsoft.Extensions.DependencyInjection;
+
+public static class ConfigurationExtensions
+{
+ public static Dictionary ConvertToDictionary(this IConfiguration configuration)
+ {
+ var data = new Dictionary(StringComparer.OrdinalIgnoreCase);
+ GetData(configuration, configuration.GetChildren(), ref data);
+ return data;
+ }
+
+ private static void GetData(
+ IConfiguration configuration,
+ IEnumerable configurationSections,
+ ref Dictionary dictionary)
+ {
+ foreach (var configurationSection in configurationSections)
+ {
+ var section = configuration.GetSection(configurationSection.Path);
+
+ var childrenSections = section.GetChildren()?.ToList() ?? new List();
+
+ if (!section.Exists() || !childrenSections.Any())
+ {
+ var key = section.Path;
+ if (!dictionary.ContainsKey(key))
+ {
+ dictionary.Add(key, configuration[section.Path]);
+ }
+ }
+ else
+ {
+ GetData(configuration, childrenSections, ref dictionary);
+ }
+ }
+ }
+}
diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Constants/ErrorCode.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Constants/ErrorCode.cs
new file mode 100644
index 000000000..86cbd151d
--- /dev/null
+++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Constants/ErrorCode.cs
@@ -0,0 +1,251 @@
+// Copyright (c) MASA Stack All rights reserved.
+// Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+
+namespace Masa.BuildingBlocks.Data.Constants;
+
+public static class ErrorCode
+{
+ public const string FRAMEWORK_PREFIX = "MF";
+
+ #region Type
+
+ ///
+ /// Internal service error
+ ///
+ private const string INTERNAL_SERVER = $"{FRAMEWORK_PREFIX}SVR";
+
+ ///
+ /// parameter validation error
+ ///
+ private const string ARGUMENT = $"{FRAMEWORK_PREFIX}ARG";
+
+ #endregion
+
+ #region Argument Verify
+
+ ///
+ /// '{PropertyName}' is not a valid email address.
+ ///
+ [Description("'{0}' is not a valid email address.")]
+ public const string EMAIL_VALIDATOR = $"{ARGUMENT}0001";
+
+ ///
+ /// '{PropertyName}' must be greater than or equal to '{ComparisonValue}'.
+ ///
+ [Description("'{0}' must be greater than or equal to '{1}'.")]
+ public const string GREATER_THAN_OR_EQUAL_VALIDATOR = $"{ARGUMENT}0002";
+
+ ///
+ /// '{PropertyName}' must be greater than '{ComparisonValue}'.
+ ///
+ [Description("'{0}' must be greater than '{1}'.")]
+ public const string GREATER_THAN_VALIDATOR = $"{ARGUMENT}0003";
+
+ ///
+ /// '{PropertyName}' must be between {MinLength} and {MaxLength} characters. You entered {TotalLength} characters.
+ ///
+ [Description("'{0}' must be between {1} and {2} characters. You entered {3} characters.")]
+ public const string LENGTH_VALIDATOR = $"{ARGUMENT}0004";
+
+ ///
+ /// The length of '{PropertyName}' must be at least {MinLength} characters. You entered {TotalLength} characters.
+ ///
+ [Description("The length of '{0}' must be at least {1} characters. You entered {2} characters.")]
+ public const string MINIMUM_LENGTH_VALIDATOR = $"{ARGUMENT}0005";
+
+ ///
+ /// The length of '{PropertyName}' must be {MaxLength} characters or fewer. You entered {TotalLength} characters.
+ ///
+ [Description("The length of '{0}' must be {1} characters or fewer. You entered {2} characters.")]
+ public const string MAXIMUM_LENGTH_VALIDATOR = $"{ARGUMENT}0006";
+
+ ///
+ /// '{PropertyName}' must be less than or equal to '{ComparisonValue}'.
+ ///
+ [Description("'{0}' must be less than or equal to '{1}'.")]
+ public const string LESS_THAN_OR_EQUAL_VALIDATOR = $"{ARGUMENT}0007";
+
+ ///
+ /// '{PropertyName}' must be less than '{ComparisonValue}'.
+ ///
+ [Description("'{0}' must be less than '{1}'.")]
+ public const string LESS_THAN_VALIDATOR = $"{ARGUMENT}0008";
+
+ ///
+ /// '{PropertyName}' must not be empty.
+ ///
+ [Description("'{0}' must not be empty.")]
+ public const string NOT_EMPTY_VALIDATOR = $"{ARGUMENT}0009";
+
+ ///
+ /// '{PropertyName}' must not be equal to '{ComparisonValue}'.
+ ///
+ [Description("'{0}' must not be equal to '{1}'.")]
+ public const string NOT_EQUAL_VALIDATOR = $"{ARGUMENT}0010";
+
+ ///
+ /// '{PropertyName}' must not be empty.
+ ///
+ [Description("'{0}' must not be empty.")]
+ public const string NOT_NULL_VALIDATOR = $"{ARGUMENT}0011";
+
+ ///
+ /// The specified condition was not met for '{0}'.
+ ///
+ [Description("The specified condition was not met for '{0}'.")]
+ public const string PREDICATE_VALIDATOR = $"{ARGUMENT}0012";
+
+ ///
+ /// The specified condition was not met for '{0}'.
+ ///
+ [Description("The specified condition was not met for '{0}'.")]
+ public const string ASYNC_PREDICATE_VALIDATOR = $"{ARGUMENT}0013";
+
+ ///
+ /// '{PropertyName}' is not in the correct format.
+ ///
+ [Description("'{0}' is not in the correct format.")]
+ public const string REGULAR_EXPRESSION_VALIDATOR = $"{ARGUMENT}0014";
+
+ ///
+ /// '{PropertyName}' must be equal to '{ComparisonValue}'.
+ ///
+ [Description("'{0}' must be equal to '{1}'.")]
+ public const string EQUAL_VALIDATOR = $"{ARGUMENT}0015";
+
+ ///
+ /// '{PropertyName}' must be {MaxLength} characters in length. You entered {TotalLength} characters.
+ ///
+ [Description("'{0}' must be {1} characters in length. You entered {2} characters.")]
+ public const string EXACT_LENGTH_VALIDATOR = $"{ARGUMENT}0016";
+
+ ///
+ /// '{PropertyName}' must be between {From} and {To}. You entered {PropertyValue}.
+ ///
+ [Description("'{0}' must be between {1} and {2}. You entered {3}.")]
+ public const string INCLUSIVE_BETWEEN_VALIDATOR = $"{ARGUMENT}0017";
+
+ ///
+ /// '{PropertyName}' must be between {From} and {To} (exclusive). You entered {PropertyValue}.
+ ///
+ [Description("'{0}' must be between {1} and {2} (exclusive). You entered {3}.")]
+ public const string EXCLUSIVE_BETWEEN_VALIDATOR = $"{ARGUMENT}0018";
+
+ ///
+ /// '{PropertyName}' cannot be null and empty.
+ ///
+ [Description("'{0}' cannot be null and empty.")]
+ public const string NOT_NULL_AND_EMPTY_VALIDATOR = $"{ARGUMENT}0019";
+
+ ///
+ /// '{PropertyName}' must not be more than {ExpectedPrecision} digits in total, with allowance for {ExpectedScale} decimals. {Digits} digits and {ActualScale} decimals were found.
+ ///
+ [Description("'{0}' must not be more than {1} digits in total, with allowance for {2} decimals. {3} digits and {4} decimals were found.")]
+ public const string SCALE_PRECISION_VALIDATOR = $"{ARGUMENT}0020";
+
+ ///
+ /// '{PropertyName}' must be empty.
+ ///
+ [Description("'{0}' must be empty.")]
+ public const string EMPTY_VALIDATOR = $"{ARGUMENT}0021";
+
+ ///
+ /// '{PropertyName}' must be empty.
+ ///
+ [Description("'{0}' must be empty.")]
+ public const string NULL_VALIDATOR = $"{ARGUMENT}0022";
+
+ ///
+ /// '{0}' has a range of values which does not include '{1}'.
+ ///
+ [Description("'{0}' has a range of values which does not include '{1}'.")]
+ public const string ENUM_VALIDATOR = $"{ARGUMENT}0023";
+
+ ///
+ /// '{PropertyName}' must be between {MinLength} and {MaxLength} characters.
+ ///
+ [Description("'{0}' must be between {1} and {2} characters.")]
+ public const string LENGTH_SIMPLE = $"{ARGUMENT}0024";
+
+ ///
+ /// The length of '{PropertyName}' must be at least {MinLength} characters.
+ ///
+ [Description("The length of '{0}' must be at least {1} characters.")]
+ public const string MINIMUM_LENGTH_SIMPLE = $"{ARGUMENT}0025";
+
+ ///
+ /// The length of '{0}' must be {1} characters or fewer.
+ ///
+ [Description("The length of '{PropertyName}' must be {MaxLength} characters or fewer.")]
+ public const string MAXIMUM_LENGTH_SIMPLE = $"{ARGUMENT}0026";
+
+ ///
+ /// '{0}' must be {1} characters in length.
+ ///
+ [Description("'{PropertyName}' must be {MaxLength} characters in length.")]
+ public const string EXACT_LENGTH_SIMPLE = $"{ARGUMENT}0027";
+
+ ///
+ /// '{0}' must be between {1} and {2}.
+ ///
+ [Description("'{PropertyName}' must be between {From} and {To}.")]
+ public const string INCLUSIVE_BETWEEN_SIMPLE = $"{ARGUMENT}0028";
+
+ ///
+ /// '{PropertyName}' cannot be Null or empty collection.
+ ///
+ [Description("'{0}' cannot be Null or empty collection.")]
+ public const string NOT_NULL_AND_EMPTY_COLLECTION_VALIDATOR = $"{ARGUMENT}0029";
+
+ ///
+ /// '{PropertyName}' cannot be Null or whitespace.
+ ///
+ [Description("'{0}' cannot be Null or whitespace.")]
+ public const string NOT_NULL_AND_WHITESPACE_VALIDATOR = $"{ARGUMENT}0030";
+
+ ///
+ /// '{PropertyName}' cannot contain {Content}.
+ ///
+ [Description("'{0}' cannot contain {1}.")]
+ public const string NOT_CONTAIN_VALIDATOR = $"{ARGUMENT}0031";
+
+ ///
+ /// '{PropertyName}' must be greater than or equal to '{min}' and less than or equal to '{max}'.
+ ///
+ [Description("'{0}' must be greater than or equal to '{1}' and less than or equal to '{2}'.")]
+ public const string OUT_OF_RANGE_VALIDATOR = $"{ARGUMENT}0032";
+
+ #endregion
+
+ #region Other
+
+ ///
+ /// Internal service error
+ ///
+ [Description("Internal service error")]
+ public const string INTERNAL_SERVER_ERROR = $"{INTERNAL_SERVER}0001";
+
+ #endregion
+
+ private static readonly Dictionary _errorCodeMessageDictionary = new();
+
+ static ErrorCode()
+ {
+ var classType = typeof(ErrorCode);
+ var fields = classType.GetFields(BindingFlags.Static | BindingFlags.Public);
+ foreach (var field in fields)
+ {
+ var errorMessage = AttributeUtils.GetDescriptionByField(field);
+
+ _errorCodeMessageDictionary.Add(field.GetRawConstantValue()!.ToString()!, errorMessage);
+ }
+ }
+
+ public static string? GetErrorMessage(string errorCode)
+ {
+ if (_errorCodeMessageDictionary.TryGetValue(errorCode, out string? errorMessage))
+ return errorMessage;
+
+ return null;
+ }
+}
diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj
index ff0c10660..7bcbe02ba 100644
--- a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj
+++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj
@@ -11,6 +11,7 @@
+
diff --git a/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa.BuildingBlocks.Development.DaprStarter.csproj b/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa.BuildingBlocks.Development.DaprStarter.csproj
index f20f98800..d09170b61 100644
--- a/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa.BuildingBlocks.Development.DaprStarter.csproj
+++ b/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa.BuildingBlocks.Development.DaprStarter.csproj
@@ -7,7 +7,8 @@
-
+
+
diff --git a/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Options/DaprOptions.cs b/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Options/DaprOptions.cs
index 92e1b341f..387ed3720 100644
--- a/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Options/DaprOptions.cs
+++ b/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Options/DaprOptions.cs
@@ -28,10 +28,7 @@ public string AppIdDelimiter
get => _appIdDelimiter;
set
{
- if (value == ".")
- {
- throw new NotSupportedException("AppIdDelimiter is not supported as .");
- }
+ MasaArgumentException.ThrowIfContain(value, ".", nameof(AppIdDelimiter));
_appIdDelimiter = value;
}
@@ -49,10 +46,7 @@ public string? AppIdSuffix
get => _appIdSuffix;
set
{
- if (value == ".")
- {
- throw new NotSupportedException("AppIdSuffix is not supported as .");
- }
+ MasaArgumentException.ThrowIfContain(value, ".", nameof(AppIdSuffix));
_appIdSuffix = value;
}
@@ -75,10 +69,8 @@ public int? MaxConcurrency
get => _maxConcurrency;
set
{
- if (value is <= 0)
- {
- throw new NotSupportedException($"{nameof(MaxConcurrency)} must be greater than 0 .");
- }
+ if (value != null)
+ MasaArgumentException.ThrowIfLessThanOrEqual(value.Value, (ushort)0, nameof(MaxConcurrency));
_maxConcurrency = value;
}
@@ -95,8 +87,8 @@ public ushort? AppPort
get => _appPort;
set
{
- if (value is <= 0)
- throw new NotSupportedException($"{nameof(AppPort)} must be greater than 0 .");
+ if (value != null)
+ MasaArgumentException.ThrowIfLessThanOrEqual(value.Value, (ushort)0, nameof(AppPort));
_appPort = value;
}
@@ -140,8 +132,8 @@ public ushort? DaprGrpcPort
get => _daprGrpcPort;
set
{
- if (value is <= 0)
- throw new NotSupportedException($"{nameof(DaprGrpcPort)} must be greater than 0 .");
+ if (value != null)
+ MasaArgumentException.ThrowIfLessThanOrEqual(value.Value, (ushort)0, nameof(DaprGrpcPort));
_daprGrpcPort = value;
}
@@ -158,8 +150,8 @@ public ushort? DaprHttpPort
get => _daprHttpPort;
set
{
- if (value is <= 0)
- throw new NotSupportedException($"{nameof(DaprHttpPort)} must be greater than 0 .");
+ if (value != null)
+ MasaArgumentException.ThrowIfLessThanOrEqual(value.Value, (ushort)0, nameof(DaprHttpPort));
_daprHttpPort = value;
}
@@ -220,8 +212,8 @@ public ushort? ProfilePort
get => _profilePort;
set
{
- if (value is <= 0)
- throw new NotSupportedException($"{nameof(ProfilePort)} must be greater than 0 .");
+ if (value != null)
+ MasaArgumentException.ThrowIfLessThanOrEqual(value.Value, (ushort)0, nameof(ProfilePort));
_profilePort = value;
}
@@ -245,8 +237,8 @@ public int? DaprMaxRequestSize
get => _daprMaxRequestSize;
set
{
- if (value is <= 0)
- throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than 0 .");
+ if (value != null)
+ MasaArgumentException.ThrowIfLessThanOrEqual(value.Value, (ushort)0, nameof(DaprMaxRequestSize));
_daprMaxRequestSize = value;
}
@@ -264,8 +256,7 @@ public int HeartBeatInterval
get => _heartBeatInterval;
set
{
- if (value < 0)
- throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than or equal to 0 .");
+ MasaArgumentException.ThrowIfLessThanOrEqual(value, (ushort)0, nameof(HeartBeatInterval));
_heartBeatInterval = value;
}
diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/Masa.BuildingBlocks.Exceptions.Tests.csproj b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/Masa.BuildingBlocks.Exceptions.Tests.csproj
new file mode 100644
index 000000000..da55be1b8
--- /dev/null
+++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/Masa.BuildingBlocks.Exceptions.Tests.csproj
@@ -0,0 +1,21 @@
+
+
+
+ net6.0
+ enable
+ enable
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/MasaArgumentExceptionTest.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/MasaArgumentExceptionTest.cs
new file mode 100644
index 000000000..eb72cda6a
--- /dev/null
+++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/MasaArgumentExceptionTest.cs
@@ -0,0 +1,26 @@
+// Copyright (c) MASA Stack All rights reserved.
+// Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+
+namespace Masa.BuildingBlocks.Exceptions.Tests;
+
+[TestClass]
+public class MasaArgumentExceptionTest
+{
+ [TestMethod]
+ public void TestThrowIfNull()
+ {
+ object? str = null;
+
+ try
+ {
+ MasaValidatorException.ThrowIfNull("");
+
+ MasaArgumentException.ThrowIfNull(str);
+ }
+ catch (MasaArgumentException ex)
+ {
+ Assert.AreEqual(Data.Constants.ErrorCode.NOT_NULL_VALIDATOR, ex.ErrorCode);
+ Assert.AreEqual("'{0}' must not be empty.", ex.GetErrorMessage());
+ }
+ }
+}
diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/_Imports.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/_Imports.cs
new file mode 100644
index 000000000..fb23b4d18
--- /dev/null
+++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/_Imports.cs
@@ -0,0 +1,7 @@
+// Copyright (c) MASA Stack All rights reserved.
+// Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+
+global using System.Diagnostics.CodeAnalysis;
+global using System.Runtime.Serialization;
+global using System.Runtime.CompilerServices;
+global using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/Masa.BuildingBlocks.Exceptions.csproj b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/Masa.BuildingBlocks.Exceptions.csproj
new file mode 100644
index 000000000..63c029362
--- /dev/null
+++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/Masa.BuildingBlocks.Exceptions.csproj
@@ -0,0 +1,19 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaArgumentException.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaArgumentException.cs
new file mode 100644
index 000000000..b4ce32027
--- /dev/null
+++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaArgumentException.cs
@@ -0,0 +1,206 @@
+// Copyright (c) MASA Stack All rights reserved.
+// Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+
+// ReSharper disable once CheckNamespace
+
+namespace System;
+
+[Serializable]
+public class MasaArgumentException : MasaException
+{
+ private string? _paramName;
+ protected string? ParamName => _paramName;
+
+ public MasaArgumentException(
+ string message,
+ LogLevel? logLevel = null)
+ : base(message, logLevel)
+ {
+ }
+
+ public MasaArgumentException(
+ string message,
+ string paramName,
+ LogLevel? logLevel = null)
+ : base(message, logLevel)
+ {
+ _paramName = paramName;
+ }
+
+ public MasaArgumentException(
+ string? paramName,
+ string errorCode,
+ LogLevel? logLevel = null,
+ params object[] parameters)
+ : this((Exception?)null, errorCode, logLevel, parameters)
+ {
+ _paramName = paramName;
+ }
+
+ public MasaArgumentException(
+ Exception? innerException,
+ string errorCode,
+ LogLevel? logLevel = null,
+ params object[] parameters)
+ : base(innerException, errorCode, logLevel, parameters)
+ {
+ }
+
+ public MasaArgumentException(string message, Exception? innerException, LogLevel? logLevel = null)
+ : base(message, innerException, logLevel)
+ {
+ }
+
+ protected MasaArgumentException(SerializationInfo serializationInfo, StreamingContext context)
+ : base(serializationInfo, context)
+ {
+ }
+
+ public static void ThrowIfNullOrEmptyCollection(IEnumerable? arguments,
+ [CallerArgumentExpression("arguments")]
+ string? paramName = null)
+ {
+ ThrowIf(arguments is null || !arguments.Any(),
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.NOT_NULL_AND_EMPTY_COLLECTION_VALIDATOR);
+ }
+
+ public static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
+ {
+ ThrowIf(argument is null,
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.NOT_NULL_VALIDATOR);
+ }
+
+ public static void ThrowIfNullOrEmpty(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
+ {
+ ThrowIf(string.IsNullOrEmpty(argument?.ToString()),
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.NOT_NULL_AND_EMPTY_VALIDATOR);
+ }
+
+ public static void ThrowIfNullOrWhiteSpace(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
+ {
+ ThrowIf(string.IsNullOrWhiteSpace(argument?.ToString()),
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.NOT_NULL_AND_WHITESPACE_VALIDATOR);
+ }
+
+ public static void ThrowIfGreaterThan(T argument,
+ T maxValue,
+ [CallerArgumentExpression("argument")] string? paramName = null) where T : IComparable
+ {
+ ThrowIf(argument.CompareTo(maxValue) > 0,
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.LESS_THAN_OR_EQUAL_VALIDATOR,
+ null,
+ maxValue);
+ }
+
+ public static void ThrowIfGreaterThanOrEqual(T argument,
+ T maxValue,
+ [CallerArgumentExpression("argument")] string? paramName = null) where T : IComparable
+ {
+ ThrowIf(argument.CompareTo(maxValue) >= 0,
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.LESS_THAN_VALIDATOR,
+ null,
+ maxValue);
+ }
+
+ public static void ThrowIfLessThan(T argument,
+ T minValue,
+ [CallerArgumentExpression("argument")] string? paramName = null) where T : IComparable
+ {
+ ThrowIf(argument.CompareTo(minValue) < 0,
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.GREATER_THAN_OR_EQUAL_VALIDATOR,
+ null,
+ minValue);
+ }
+
+ public static void ThrowIfLessThanOrEqual(T argument,
+ T minValue,
+ [CallerArgumentExpression("argument")] string? paramName = null) where T : IComparable
+ {
+ ThrowIf(argument.CompareTo(minValue) <= 0,
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.GREATER_THAN_VALIDATOR,
+ null,
+ minValue);
+ }
+
+ public static void ThrowIfOutOfRange(T argument,
+ T minValue,
+ T maxValue,
+ [CallerArgumentExpression("argument")] string? paramName = null) where T : IComparable
+ {
+ ThrowIf(argument.CompareTo(minValue) < 0 || argument.CompareTo(maxValue) > 0,
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.OUT_OF_RANGE_VALIDATOR,
+ null,
+ minValue,
+ maxValue);
+ }
+
+ public static void ThrowIfContain(string? argument,
+ string parameter,
+ [CallerArgumentExpression("argument")] string? paramName = null)
+ => ThrowIfContain(argument, parameter, StringComparison.OrdinalIgnoreCase, paramName);
+
+ public static void ThrowIfContain(string? argument,
+ string parameter,
+ StringComparison stringComparison,
+ [CallerArgumentExpression("argument")] string? paramName = null)
+ {
+ if (argument != null)
+ ThrowIf(argument.Contains(parameter, stringComparison),
+ paramName,
+ Masa.BuildingBlocks.Data.Constants.ErrorCode.NOT_CONTAIN_VALIDATOR
+ );
+ }
+
+ public static void ThrowIf(
+ bool condition,
+ string? paramName,
+ string errorCode,
+ LogLevel? logLevel = null,
+ params object[] parameters)
+ {
+ if (condition)
+ Throw(paramName, errorCode, Masa.BuildingBlocks.Data.Constants.ErrorCode.GetErrorMessage(errorCode), logLevel, parameters);
+ }
+
+ public static void ThrowIf(
+ bool condition,
+ string? paramName,
+ string errorCode,
+ string? errorMessage,
+ LogLevel? logLevel = null,
+ params object[] parameters)
+ {
+ if (condition) Throw(paramName, errorCode, errorMessage, logLevel, parameters);
+ }
+
+ [DoesNotReturn]
+ private static void Throw(
+ string? paramName,
+ string errorCode,
+ string? errorMessage,
+ LogLevel? logLevel,
+ params object[] parameters) =>
+ throw new MasaArgumentException(paramName, errorCode, logLevel, parameters)
+ {
+ ErrorMessage = errorMessage
+ };
+
+ protected override object[] GetParameters()
+ {
+ var parameters = new List