diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..2c1b6e7
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,42 @@
+# You can modify the rules from these initially generated values to suit your own policies
+# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
+[*.cs]
+
+#Core editorconfig formatting - indentation
+
+#use hard tabs for indentation
+indent_style = tab
+
+#Formatting - new line options
+
+#require braces to be on a new line for types and methods (also known as "Allman" style)
+csharp_new_line_before_open_brace = types, methods
+
+#Formatting - organize using options
+
+#sort System.* using directives alphabetically, and place them before other usings
+dotnet_sort_system_directives_first = true
+
+#Formatting - spacing options
+
+#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
+csharp_space_between_method_declaration_parameter_list_parentheses = false
+
+#Style - expression bodied member options
+
+#prefer block bodies for constructors
+csharp_style_expression_bodied_constructors = false : suggestion
+#prefer block bodies for methods
+csharp_style_expression_bodied_methods = false : suggestion
+
+#Style - language keyword and framework type options
+
+#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
+dotnet_style_predefined_type_for_locals_parameters_members = true : suggestion
+
+#Style - qualification options
+
+#prefer properties not to be prefaced with this. or Me. in Visual Basic
+dotnet_style_qualification_for_property = false : suggestion
+
+csharp_new_line_before_open_brace = all
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index dd69add..61262c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,8 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+*.trx
+
# User-specific files
*.suo
*.user
@@ -23,6 +25,7 @@ bld/
[Bb]in/
[Oo]bj/
[Ll]og/
+artifacts/
# Visual Studio 2015/2017 cache/options directory
.vs/
diff --git a/.nuke b/.nuke
new file mode 100644
index 0000000..0f03334
--- /dev/null
+++ b/.nuke
@@ -0,0 +1 @@
+Beffyman.AspNetCore.Client.sln
diff --git a/AspNetCore.Client.sln b/Beffyman.AspNetCore.Client.sln
similarity index 63%
rename from AspNetCore.Client.sln
rename to Beffyman.AspNetCore.Client.sln
index 9fd6a58..9f46fba 100644
--- a/AspNetCore.Client.sln
+++ b/Beffyman.AspNetCore.Client.sln
@@ -1,225 +1,236 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28407.52
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client", "src\AspNetCore.Client\AspNetCore.Client.csproj", "{3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A0F6ACE-08C3-4894-B7D2-537B06B057BC}"
- ProjectSection(SolutionItems) = preProject
- .gitignore = .gitignore
- after.AspNetCore.Client.sln.targets = after.AspNetCore.Client.sln.targets
- appveyor.yml = appveyor.yml
- Build.ps1 = Build.ps1
- Directory.Build.targets = Directory.Build.targets
- global.json = global.json
- LICENSE = LICENSE
- NuGet.config = NuGet.config
- README.md = README.md
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F0EC1B44-13B2-4817-80A8-D67960BD79E1}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp", "test\TestWebApp\TestWebApp.csproj", "{303D91A0-1A4E-4F98-A81F-35072F18C19A}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Clients", "test\TestWebApp.Clients\TestWebApp.Clients.csproj", "{D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCore", "AspNetCore", "{EBC264EF-636C-42D0-9CF9-F5FD874354D4}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Blazor", "Blazor", "{DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Server", "test\TestBlazorApp.Server\TestBlazorApp.Server.csproj", "{61F66164-B2DE-4623-99B1-0407A8F56F1E}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Views", "test\TestBlazorApp.Views\TestBlazorApp.Views.csproj", "{AC543DFE-E8AD-4EB6-9C7D-1DED7A93938A}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Shared", "test\TestBlazorApp.Shared\TestBlazorApp.Shared.csproj", "{CA3BA183-5937-4484-8FDB-1A1E80C9077D}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Clients", "test\TestBlazorApp.Clients\TestBlazorApp.Clients.csproj", "{BBE6C596-7295-420D-9814-829933A8F6AF}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Tests", "test\TestWebApp.Tests\TestWebApp.Tests.csproj", "{65D34793-90AA-4641-80DC-A8B092E40DAC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Contracts", "test\TestWebApp.Contracts\TestWebApp.Contracts.csproj", "{D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client.Protobuf", "src\AspNetCore.Client.Protobuf\AspNetCore.Client.Protobuf.csproj", "{4F89E001-24D2-4464-9577-6768E31C510D}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client.BlazorJson", "src\AspNetCore.Client.BlazorJson\AspNetCore.Client.BlazorJson.csproj", "{F911F6A0-CBE9-4B4C-91AA-41C3EF3B62A3}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Tests", "test\TestBlazorApp.Tests\TestBlazorApp.Tests.csproj", "{B28C16E6-4FDB-4245-AB1B-F4928CC9B611}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client.Generator.Framework", "src\AspNetCore.Client.Generator.Framework\AspNetCore.Client.Generator.Framework.csproj", "{862DD062-0098-4700-8CDB-7570AF9655F7}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Console", "test\TestWebApp.Console\TestWebApp.Console.csproj", "{8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Functions", "Functions", "{344CED97-6C7C-4EC5-BA25-B967521598F5}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction", "test\TestAzureFunction\TestAzureFunction.csproj", "{EC486723-64AF-45BE-AC74-8021A24994AB}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction.Clients", "test\TestAzureFunction.Clients\TestAzureFunction.Clients.csproj", "{54656466-4617-4B86-AD56-4DA8C15CA640}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction.Contracts", "test\TestAzureFunction.Contracts\TestAzureFunction.Contracts.csproj", "{11133C2A-4AB2-45F5-876F-F22AB024A67C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Server", "src\AspNetCore.Server\AspNetCore.Server.csproj", "{60B21E11-0738-4A29-B518-329EA8470140}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client.MessagePack", "src\AspNetCore.Client.MessagePack\AspNetCore.Client.MessagePack.csproj", "{2075D5BC-D4B9-4B0D-948C-399200598110}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction.Tests", "test\TestAzureFunction.Tests\TestAzureFunction.Tests.csproj", "{E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Functions2", "Functions2", "{7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionApp2.Clients", "test\FunctionApp2.Clients\FunctionApp2.Clients.csproj", "{B1B79A7A-DDEC-466A-9755-78E52641C7B7}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionApp2", "test\FunctionApp2\FunctionApp2.csproj", "{3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client.Test.Generator", "test\AspNetCore.Client.Test.Generator\AspNetCore.Client.Test.Generator.csproj", "{EC477C06-BCEF-439B-A434-3EC894B7A44A}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client.Generator", "src\AspNetCore.Client.Generator\AspNetCore.Client.Generator.csproj", "{34C4FE4E-7236-4A5B-98A9-BE17EB31F0D0}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Client.JSInterop", "src\AspNetCore.Client.JSInterop\AspNetCore.Client.JSInterop.csproj", "{C2D5F971-B739-4BE6-B947-8540C81E3F77}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Release|Any CPU.Build.0 = Release|Any CPU
- {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Release|Any CPU.Build.0 = Release|Any CPU
- {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Release|Any CPU.Build.0 = Release|Any CPU
- {61F66164-B2DE-4623-99B1-0407A8F56F1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {61F66164-B2DE-4623-99B1-0407A8F56F1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {61F66164-B2DE-4623-99B1-0407A8F56F1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {61F66164-B2DE-4623-99B1-0407A8F56F1E}.Release|Any CPU.Build.0 = Release|Any CPU
- {AC543DFE-E8AD-4EB6-9C7D-1DED7A93938A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AC543DFE-E8AD-4EB6-9C7D-1DED7A93938A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AC543DFE-E8AD-4EB6-9C7D-1DED7A93938A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AC543DFE-E8AD-4EB6-9C7D-1DED7A93938A}.Release|Any CPU.Build.0 = Release|Any CPU
- {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Release|Any CPU.Build.0 = Release|Any CPU
- {BBE6C596-7295-420D-9814-829933A8F6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BBE6C596-7295-420D-9814-829933A8F6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BBE6C596-7295-420D-9814-829933A8F6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BBE6C596-7295-420D-9814-829933A8F6AF}.Release|Any CPU.Build.0 = Release|Any CPU
- {65D34793-90AA-4641-80DC-A8B092E40DAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {65D34793-90AA-4641-80DC-A8B092E40DAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {65D34793-90AA-4641-80DC-A8B092E40DAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {65D34793-90AA-4641-80DC-A8B092E40DAC}.Release|Any CPU.Build.0 = Release|Any CPU
- {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Release|Any CPU.Build.0 = Release|Any CPU
- {4F89E001-24D2-4464-9577-6768E31C510D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4F89E001-24D2-4464-9577-6768E31C510D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4F89E001-24D2-4464-9577-6768E31C510D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4F89E001-24D2-4464-9577-6768E31C510D}.Release|Any CPU.Build.0 = Release|Any CPU
- {F911F6A0-CBE9-4B4C-91AA-41C3EF3B62A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F911F6A0-CBE9-4B4C-91AA-41C3EF3B62A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F911F6A0-CBE9-4B4C-91AA-41C3EF3B62A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F911F6A0-CBE9-4B4C-91AA-41C3EF3B62A3}.Release|Any CPU.Build.0 = Release|Any CPU
- {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Release|Any CPU.Build.0 = Release|Any CPU
- {862DD062-0098-4700-8CDB-7570AF9655F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {862DD062-0098-4700-8CDB-7570AF9655F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {862DD062-0098-4700-8CDB-7570AF9655F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {862DD062-0098-4700-8CDB-7570AF9655F7}.Release|Any CPU.Build.0 = Release|Any CPU
- {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Release|Any CPU.Build.0 = Release|Any CPU
- {EC486723-64AF-45BE-AC74-8021A24994AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EC486723-64AF-45BE-AC74-8021A24994AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EC486723-64AF-45BE-AC74-8021A24994AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EC486723-64AF-45BE-AC74-8021A24994AB}.Release|Any CPU.Build.0 = Release|Any CPU
- {54656466-4617-4B86-AD56-4DA8C15CA640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {54656466-4617-4B86-AD56-4DA8C15CA640}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {54656466-4617-4B86-AD56-4DA8C15CA640}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {54656466-4617-4B86-AD56-4DA8C15CA640}.Release|Any CPU.Build.0 = Release|Any CPU
- {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Release|Any CPU.Build.0 = Release|Any CPU
- {60B21E11-0738-4A29-B518-329EA8470140}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {60B21E11-0738-4A29-B518-329EA8470140}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {60B21E11-0738-4A29-B518-329EA8470140}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {60B21E11-0738-4A29-B518-329EA8470140}.Release|Any CPU.Build.0 = Release|Any CPU
- {2075D5BC-D4B9-4B0D-948C-399200598110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2075D5BC-D4B9-4B0D-948C-399200598110}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2075D5BC-D4B9-4B0D-948C-399200598110}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2075D5BC-D4B9-4B0D-948C-399200598110}.Release|Any CPU.Build.0 = Release|Any CPU
- {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Release|Any CPU.Build.0 = Release|Any CPU
- {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Release|Any CPU.Build.0 = Release|Any CPU
- {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Release|Any CPU.Build.0 = Release|Any CPU
- {EC477C06-BCEF-439B-A434-3EC894B7A44A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EC477C06-BCEF-439B-A434-3EC894B7A44A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EC477C06-BCEF-439B-A434-3EC894B7A44A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EC477C06-BCEF-439B-A434-3EC894B7A44A}.Release|Any CPU.Build.0 = Release|Any CPU
- {34C4FE4E-7236-4A5B-98A9-BE17EB31F0D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {34C4FE4E-7236-4A5B-98A9-BE17EB31F0D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {34C4FE4E-7236-4A5B-98A9-BE17EB31F0D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {34C4FE4E-7236-4A5B-98A9-BE17EB31F0D0}.Release|Any CPU.Build.0 = Release|Any CPU
- {C2D5F971-B739-4BE6-B947-8540C81E3F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C2D5F971-B739-4BE6-B947-8540C81E3F77}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C2D5F971-B739-4BE6-B947-8540C81E3F77}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C2D5F971-B739-4BE6-B947-8540C81E3F77}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- {303D91A0-1A4E-4F98-A81F-35072F18C19A} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
- {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
- {EBC264EF-636C-42D0-9CF9-F5FD874354D4} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
- {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
- {61F66164-B2DE-4623-99B1-0407A8F56F1E} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
- {AC543DFE-E8AD-4EB6-9C7D-1DED7A93938A} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
- {CA3BA183-5937-4484-8FDB-1A1E80C9077D} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
- {BBE6C596-7295-420D-9814-829933A8F6AF} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
- {65D34793-90AA-4641-80DC-A8B092E40DAC} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
- {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
- {4F89E001-24D2-4464-9577-6768E31C510D} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- {F911F6A0-CBE9-4B4C-91AA-41C3EF3B62A3} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- {B28C16E6-4FDB-4245-AB1B-F4928CC9B611} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
- {862DD062-0098-4700-8CDB-7570AF9655F7} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
- {344CED97-6C7C-4EC5-BA25-B967521598F5} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
- {EC486723-64AF-45BE-AC74-8021A24994AB} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
- {54656466-4617-4B86-AD56-4DA8C15CA640} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
- {11133C2A-4AB2-45F5-876F-F22AB024A67C} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
- {60B21E11-0738-4A29-B518-329EA8470140} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- {2075D5BC-D4B9-4B0D-948C-399200598110} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
- {7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
- {B1B79A7A-DDEC-466A-9755-78E52641C7B7} = {7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97}
- {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314} = {7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97}
- {EC477C06-BCEF-439B-A434-3EC894B7A44A} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
- {34C4FE4E-7236-4A5B-98A9-BE17EB31F0D0} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- {C2D5F971-B739-4BE6-B947-8540C81E3F77} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {FCFD7864-E2E5-4CF3-9A6D-D53B4F4E8AE0}
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.28407.52
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client", "src\Beffyman.AspNetCore.Client\Beffyman.AspNetCore.Client.csproj", "{3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A0F6ACE-08C3-4894-B7D2-537B06B057BC}"
+ ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
+ .gitignore = .gitignore
+ Directory.Build.props = Directory.Build.props
+ Directory.Build.targets = Directory.Build.targets
+ global.json = global.json
+ LICENSE.txt = LICENSE.txt
+ README.md = README.md
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F0EC1B44-13B2-4817-80A8-D67960BD79E1}"
+ ProjectSection(SolutionItems) = preProject
+ src\Directory.Build.props = src\Directory.Build.props
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}"
+ ProjectSection(SolutionItems) = preProject
+ tests\Directory.Build.props = tests\Directory.Build.props
+ EndProjectSection
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp", "tests\TestWebApp\TestWebApp.csproj", "{303D91A0-1A4E-4F98-A81F-35072F18C19A}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Clients", "tests\TestWebApp.Clients\TestWebApp.Clients.csproj", "{D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCore", "AspNetCore", "{EBC264EF-636C-42D0-9CF9-F5FD874354D4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Blazor", "Blazor", "{DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Shared", "tests\TestBlazorApp.Shared\TestBlazorApp.Shared.csproj", "{CA3BA183-5937-4484-8FDB-1A1E80C9077D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Clients", "tests\TestBlazorApp.Clients\TestBlazorApp.Clients.csproj", "{BBE6C596-7295-420D-9814-829933A8F6AF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Tests", "tests\TestWebApp.Tests\TestWebApp.Tests.csproj", "{65D34793-90AA-4641-80DC-A8B092E40DAC}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Contracts", "tests\TestWebApp.Contracts\TestWebApp.Contracts.csproj", "{D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client.Protobuf", "src\Beffyman.AspNetCore.Client.Protobuf\Beffyman.AspNetCore.Client.Protobuf.csproj", "{4F89E001-24D2-4464-9577-6768E31C510D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Tests", "tests\TestBlazorApp.Tests\TestBlazorApp.Tests.csproj", "{B28C16E6-4FDB-4245-AB1B-F4928CC9B611}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client.Generator.Framework", "src\Beffyman.AspNetCore.Client.Generator.Framework\Beffyman.AspNetCore.Client.Generator.Framework.csproj", "{862DD062-0098-4700-8CDB-7570AF9655F7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebApp.Console", "tests\TestWebApp.Console\TestWebApp.Console.csproj", "{8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Functions", "Functions", "{344CED97-6C7C-4EC5-BA25-B967521598F5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction", "tests\TestAzureFunction\TestAzureFunction.csproj", "{EC486723-64AF-45BE-AC74-8021A24994AB}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction.Clients", "tests\TestAzureFunction.Clients\TestAzureFunction.Clients.csproj", "{54656466-4617-4B86-AD56-4DA8C15CA640}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction.Contracts", "tests\TestAzureFunction.Contracts\TestAzureFunction.Contracts.csproj", "{11133C2A-4AB2-45F5-876F-F22AB024A67C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Server", "src\Beffyman.AspNetCore.Server\Beffyman.AspNetCore.Server.csproj", "{60B21E11-0738-4A29-B518-329EA8470140}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client.MessagePack", "src\Beffyman.AspNetCore.Client.MessagePack\Beffyman.AspNetCore.Client.MessagePack.csproj", "{2075D5BC-D4B9-4B0D-948C-399200598110}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAzureFunction.Tests", "tests\TestAzureFunction.Tests\TestAzureFunction.Tests.csproj", "{E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Functions2", "Functions2", "{7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionApp2.Clients", "tests\FunctionApp2.Clients\FunctionApp2.Clients.csproj", "{B1B79A7A-DDEC-466A-9755-78E52641C7B7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionApp2", "tests\FunctionApp2\FunctionApp2.csproj", "{3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{933E4A0A-7712-4E6C-961E-9AE9147B493C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{B16EEEFF-40C6-4DC7-8CE0-2387B1AEA9E7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Server", "tests\TestBlazorApp.Server\TestBlazorApp.Server.csproj", "{D7FA09D6-2E49-4504-BD25-83799A3E2ACA}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBlazorApp.Views", "tests\TestBlazorApp.Views\TestBlazorApp.Views.csproj", "{69C58805-0300-4463-AA5B-84823DC0B443}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client.Http", "src\Beffyman.AspNetCore.Client.Http\Beffyman.AspNetCore.Client.Http.csproj", "{ACE003CE-5640-41EE-B232-71C4F574B74C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client.Generator", "src\Beffyman.AspNetCore.Client.Generator\Beffyman.AspNetCore.Client.Generator.csproj", "{BD2BA351-40FE-4729-8E63-E18522858ACF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client.Test.Generator", "tests\Beffyman.AspNetCore.Client.Test.Generator\Beffyman.AspNetCore.Client.Test.Generator.csproj", "{C841D007-BDD7-4AC9-BFCC-317BF96A9299}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beffyman.AspNetCore.Client.NewtonsoftJson", "src\Beffyman.AspNetCore.Client.NewtonsoftJson\Beffyman.AspNetCore.Client.NewtonsoftJson.csproj", "{CCFCBB7F-2DB8-44A6-B142-2879DB563968}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012}.Release|Any CPU.Build.0 = Release|Any CPU
+ {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {303D91A0-1A4E-4F98-A81F-35072F18C19A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CA3BA183-5937-4484-8FDB-1A1E80C9077D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BBE6C596-7295-420D-9814-829933A8F6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BBE6C596-7295-420D-9814-829933A8F6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BBE6C596-7295-420D-9814-829933A8F6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BBE6C596-7295-420D-9814-829933A8F6AF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {65D34793-90AA-4641-80DC-A8B092E40DAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {65D34793-90AA-4641-80DC-A8B092E40DAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {65D34793-90AA-4641-80DC-A8B092E40DAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {65D34793-90AA-4641-80DC-A8B092E40DAC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4F89E001-24D2-4464-9577-6768E31C510D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4F89E001-24D2-4464-9577-6768E31C510D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4F89E001-24D2-4464-9577-6768E31C510D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4F89E001-24D2-4464-9577-6768E31C510D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B28C16E6-4FDB-4245-AB1B-F4928CC9B611}.Release|Any CPU.Build.0 = Release|Any CPU
+ {862DD062-0098-4700-8CDB-7570AF9655F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {862DD062-0098-4700-8CDB-7570AF9655F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {862DD062-0098-4700-8CDB-7570AF9655F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {862DD062-0098-4700-8CDB-7570AF9655F7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EC486723-64AF-45BE-AC74-8021A24994AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EC486723-64AF-45BE-AC74-8021A24994AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EC486723-64AF-45BE-AC74-8021A24994AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EC486723-64AF-45BE-AC74-8021A24994AB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {54656466-4617-4B86-AD56-4DA8C15CA640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {54656466-4617-4B86-AD56-4DA8C15CA640}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {54656466-4617-4B86-AD56-4DA8C15CA640}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {54656466-4617-4B86-AD56-4DA8C15CA640}.Release|Any CPU.Build.0 = Release|Any CPU
+ {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {11133C2A-4AB2-45F5-876F-F22AB024A67C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {60B21E11-0738-4A29-B518-329EA8470140}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {60B21E11-0738-4A29-B518-329EA8470140}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {60B21E11-0738-4A29-B518-329EA8470140}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {60B21E11-0738-4A29-B518-329EA8470140}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2075D5BC-D4B9-4B0D-948C-399200598110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2075D5BC-D4B9-4B0D-948C-399200598110}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2075D5BC-D4B9-4B0D-948C-399200598110}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2075D5BC-D4B9-4B0D-948C-399200598110}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B1B79A7A-DDEC-466A-9755-78E52641C7B7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314}.Release|Any CPU.Build.0 = Release|Any CPU
+ {933E4A0A-7712-4E6C-961E-9AE9147B493C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {933E4A0A-7712-4E6C-961E-9AE9147B493C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D7FA09D6-2E49-4504-BD25-83799A3E2ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D7FA09D6-2E49-4504-BD25-83799A3E2ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D7FA09D6-2E49-4504-BD25-83799A3E2ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D7FA09D6-2E49-4504-BD25-83799A3E2ACA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {69C58805-0300-4463-AA5B-84823DC0B443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {69C58805-0300-4463-AA5B-84823DC0B443}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {69C58805-0300-4463-AA5B-84823DC0B443}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {69C58805-0300-4463-AA5B-84823DC0B443}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ACE003CE-5640-41EE-B232-71C4F574B74C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ACE003CE-5640-41EE-B232-71C4F574B74C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ACE003CE-5640-41EE-B232-71C4F574B74C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ACE003CE-5640-41EE-B232-71C4F574B74C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BD2BA351-40FE-4729-8E63-E18522858ACF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BD2BA351-40FE-4729-8E63-E18522858ACF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BD2BA351-40FE-4729-8E63-E18522858ACF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BD2BA351-40FE-4729-8E63-E18522858ACF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C841D007-BDD7-4AC9-BFCC-317BF96A9299}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C841D007-BDD7-4AC9-BFCC-317BF96A9299}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C841D007-BDD7-4AC9-BFCC-317BF96A9299}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C841D007-BDD7-4AC9-BFCC-317BF96A9299}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CCFCBB7F-2DB8-44A6-B142-2879DB563968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CCFCBB7F-2DB8-44A6-B142-2879DB563968}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CCFCBB7F-2DB8-44A6-B142-2879DB563968}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CCFCBB7F-2DB8-44A6-B142-2879DB563968}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {3709B2AC-A6E2-4707-A2F4-DBE6AFC3A012} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ {303D91A0-1A4E-4F98-A81F-35072F18C19A} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
+ {D59C431C-CAB3-4BAD-8AAA-2D2042E492D3} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
+ {EBC264EF-636C-42D0-9CF9-F5FD874354D4} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
+ {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
+ {CA3BA183-5937-4484-8FDB-1A1E80C9077D} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
+ {BBE6C596-7295-420D-9814-829933A8F6AF} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
+ {65D34793-90AA-4641-80DC-A8B092E40DAC} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
+ {D21B21B7-CCF3-4C68-8F90-DC045ABE3DCA} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
+ {4F89E001-24D2-4464-9577-6768E31C510D} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ {B28C16E6-4FDB-4245-AB1B-F4928CC9B611} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
+ {862DD062-0098-4700-8CDB-7570AF9655F7} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ {8150D22C-D1F4-4D14-9B39-2D81A2B75FA7} = {EBC264EF-636C-42D0-9CF9-F5FD874354D4}
+ {344CED97-6C7C-4EC5-BA25-B967521598F5} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
+ {EC486723-64AF-45BE-AC74-8021A24994AB} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
+ {54656466-4617-4B86-AD56-4DA8C15CA640} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
+ {11133C2A-4AB2-45F5-876F-F22AB024A67C} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
+ {60B21E11-0738-4A29-B518-329EA8470140} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ {2075D5BC-D4B9-4B0D-948C-399200598110} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ {E58B7973-8AF8-4FEF-8855-F10DEFCB7A92} = {344CED97-6C7C-4EC5-BA25-B967521598F5}
+ {7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
+ {B1B79A7A-DDEC-466A-9755-78E52641C7B7} = {7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97}
+ {3AF190F0-6B8E-47B3-9C29-F4A0EE19D314} = {7BFCD5A4-715F-47CA-BFB4-ED3CD7D70F97}
+ {933E4A0A-7712-4E6C-961E-9AE9147B493C} = {B16EEEFF-40C6-4DC7-8CE0-2387B1AEA9E7}
+ {D7FA09D6-2E49-4504-BD25-83799A3E2ACA} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
+ {69C58805-0300-4463-AA5B-84823DC0B443} = {DAA1FF40-201F-444E-A3EF-FB83FB5D8F96}
+ {ACE003CE-5640-41EE-B232-71C4F574B74C} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ {BD2BA351-40FE-4729-8E63-E18522858ACF} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ {C841D007-BDD7-4AC9-BFCC-317BF96A9299} = {765F8CBA-ECD0-4E5B-AB1D-AC0F508A05AC}
+ {CCFCBB7F-2DB8-44A6-B142-2879DB563968} = {F0EC1B44-13B2-4817-80A8-D67960BD79E1}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {FCFD7864-E2E5-4CF3-9A6D-D53B4F4E8AE0}
+ EndGlobalSection
+EndGlobal
diff --git a/Build.ps1 b/Build.ps1
index 261f2b0..658f1f1 100644
--- a/Build.ps1
+++ b/Build.ps1
@@ -1,126 +1,139 @@
-# Make so the script will stop when it hits an error.
-$ErrorActionPreference = "Stop"
-
-# Get the executing directory and set it to the current directory.
-$scriptBin = ""
-Try { $scriptBin = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" } Catch {}
-If ([string]::IsNullOrEmpty($scriptBin)) { $scriptBin = $pwd }
-Set-Location $scriptBin
-
-$version = $env:APPVEYOR_BUILD_VERSION;
-$localBuild = $false;
-#For local builds, appveyor will be provided version
-if([System.String]::IsNullOrEmpty($version)){
- $version = & git describe --tags;
- $localBuild = $true;
+[CmdletBinding()]
+Param(
+ [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
+ [string[]]$BuildArguments
+)
+
+Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)"
+
+Set-StrictMode -Version 2.0;
+$ErrorActionPreference = "Stop";
+$ConfirmPreference = "None";
+trap {
+ Write-Error $_;
+ exit 1
}
-#Filter out - branch commit locally
-if($version -Match "-"){
- $version = $version.Split("-")[0];
-}
-
-#Filter out +Build# from CI builds
-if($version -Match "\+"){
- $version = $version.Split("+")[0];
-}
-
-
-if($localBuild -eq $true){
- $build = & git rev-list --count HEAD;
- $version = "$($version)$build";
-}
-
+$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
-Write-Host "---Version $version will be used---" -ForegroundColor Magenta;
+###########################################################################
+# CONFIGURATION
+###########################################################################
-$artifacts = "$scriptBin/artifacts";
-$testGenerator = Resolve-Path "$scriptBin/test/AspNetCore.Client.Test.Generator";
+$BuildProjectFile = "$PSScriptRoot\build\_build.csproj"
+$TempDirectory = "$PSScriptRoot\\.tmp"
-Get-ChildItem -Path $artifacts -Filter "*.nupkg" -Recurse | Remove-item -ErrorAction Ignore;
-$outputDir = Resolve-Path $artifacts;
+$DotNetGlobalFile = "$PSScriptRoot\\global.json"
+$DotNetInstallUrlPowershell = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1"
+$DotNetInstallUrlBash = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh"
+$DotNetChannel = "Current"
-Write-Host ">> dotnet --info" -ForegroundColor Magenta;
-dotnet --info
+$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
+$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
+$env:NUGET_XMLDOC_MODE = "skip"
-Write-Host ">> dotnet clean -c Release -v m" -ForegroundColor Magenta;
-dotnet clean -c Release -v m
+###########################################################################
+# EXECUTION
+###########################################################################
-Write-Host ">> dotnet build -c Release -v m;" -ForegroundColor Magenta;
-dotnet build -c Release -v m;
+function ExecSafe([scriptblock] $cmd) {
+ & $cmd
-if($LastExitCode -ne 0){
- throw "Build failed"
+ if((Get-Variable -Name "LASTEXITCODE" -Scope Global -ErrorAction SilentlyContinue) -ne $null) {
+ if ($LASTEXITCODE) {
+ exit $LASTEXITCODE
+ }
+ }
}
-#Run the test project generators
-Push-Location -Path $testGenerator -StackName "Run";
-Write-Host ">> dotnet run -c Release -v m;" -ForegroundColor Magenta;
-dotnet run -c Release -v m --framework netcoreapp2.2;
-Pop-Location -StackName "Run";
-
-#Build again, making sure that our clients that were just regenerated via the previous command build
-Write-Host ">> dotnet build -c Release -v m;" -ForegroundColor Magenta;
-dotnet build -c Release -v m;
-
-
-if($LastExitCode -ne 0){
- throw "Build failed"
+# If global.json exists, load expected version
+if (Test-Path $DotNetGlobalFile) {
+ $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json)
+ if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) {
+ $DotNetVersion = $DotNetGlobal.sdk.version
+ }
}
-Write-Host ">> dotnet test -c Release -v m;" -ForegroundColor Magenta;
-dotnet test -c Release -v m;
-
-
-if($LastExitCode -ne 0){
- throw "Tests failed"
+# If dotnet is installed locally, and expected version is not set or installation matches the expected version
+if((Get-Variable IsWindows -ErrorAction SilentlyContinue) -eq $null){
+ $DotNetSuffix = "win";
+ $DotNetExtension = ".exe";
+ $DotNetInstallUrl = $DotNetInstallUrlPowershell;
+ $DotNetInstallExtension = "ps1";
}
-
-Write-Host ">> dotnet pack -c Release /p:Version=$version -o $outputDir -v m" -ForegroundColor Magenta;
-dotnet pack -c Release /p:Version="$version" -o $outputDir -v m
-
-
-if($LastExitCode -ne 0){
- throw "Pack failed"
+else{
+ $DotNetSuffix = if($IsWindows -eq $false -or $IsWindows -eq $null){"unix"} else{"win"};
+ $DotNetExtension = if($IsWindows -eq $false -or $IsWindows -eq $null){""} else{".exe"};
+ $DotNetInstallUrl = if($IsWindows -eq $false -or $IsWindows -eq $null){$DotNetInstallUrlBash} else{$DotNetInstallUrlPowershell};
+ $DotNetInstallExtension = if($IsWindows -eq $false -or $IsWindows -eq $null){"sh"} else{"ps1"};
}
-Write-Host "Remove Client.cs files so we can regenerate them with the msbuild task to make that works" -ForegroundColor Magenta;
-Get-ChildItem -Path "**/Clients.cs" -Recurse | Remove-Item -Force
-
-#Remove the generator from the solution so we don't have two references to it's assembly which causes the generator to fail.
-
-dotnet sln remove "test/AspNetCore.Client.Test.Generator/AspNetCore.Client.Test.Generator.csproj"
-dotnet sln remove "src/AspNetCore.Client.Generator/AspNetCore.Client.Generator.csproj"
-
-try{
- Write-Host ">> dotnet clean -c Release -v m" -ForegroundColor Magenta;
- dotnet clean -c Release -v m
-
- #Build again, making sure our build task works
- Write-Host ">> dotnet build -c Release -v m /p:GenerateWithNuget=true" -ForegroundColor Magenta;
- dotnet build -c Release /p:GenerateWithNuget=true;
+$DotNetDirectory = "$TempDirectory\dotnet-$DotNetSuffix"
+$DotNetVersionDirectory = "$DotNetDirectory\sdk\$DotNetVersion"
+$env:DOTNET_EXE = "$DotNetDirectory\dotnet$DotNetExtension"
- if($LastExitCode -ne 0){
- throw "Build failed"
- }
+if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
+ (!(Test-Path variable:DotNetVersion) -or "$(& dotnet --version | Select-Object -First 1)" -eq "$DotNetVersion")) {
- Write-Host ">> dotnet test -c Release -v m /p:GenerateWithNuget=true" -ForegroundColor Magenta;
- dotnet test -c Release;
+ Write-Host "Existing dotnet install discovered";
- if($LastExitCode -ne 0){
- throw "Tests failed"
- }
+ (dotnet --list-sdks) | Out-Host
+ $env:DOTNET_EXE = (Get-Command "dotnet").Path
}
-catch{
- throw $_
-}
-finally{
- #Readd them, for locals
- dotnet sln add "test/AspNetCore.Client.Test.Generator/AspNetCore.Client.Test.Generator.csproj"
- dotnet sln add "src/AspNetCore.Client.Generator/AspNetCore.Client.Generator.csproj"
+else{
+ if(!(Test-Path $DotNetVersionDirectory)){
+ # Download install script
+ $DotNetInstallFile = "$TempDirectory\dotnet-install.$DotNetInstallExtension"
+ New-Item -ItemType Directory -Force -Path $TempDirectory | Out-Null
+ (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)
+
+ # Install by channel or version
+ if (!(Test-Path variable:DotNetVersion)) {
+ if($DotNetInstallExtension -eq "ps1"){
+ ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
+ }
+ elseif ($DotNetInstallExtension -eq "sh"){
+ ExecSafe { & "$DotNetInstallFile" --install-dir "$DotNetDirectory" --channel "$DotNetChannel" --no-path }
+ }
+ else{
+ throw "Unknown install extension";
+ }
+ } else {
+ if($DotNetInstallExtension -eq "ps1"){
+ ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
+ }
+ elseif ($DotNetInstallExtension -eq "sh"){
+ ExecSafe { & "$DotNetInstallFile" --install-dir "$DotNetDirectory" --version "$DotNetVersion" --no-path }
+ }
+ else{
+ throw "Unknown install extension";
+ }
+ }
+ }
}
+$env:PATH += $DotNetDirectory;
+$env:DOTNET_ROOT = $DotNetDirectory;
+Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
+#Output a bunch of diag info
+Write-Host "[DotNetVersion] = $DotNetVersion";
+Write-Host "[DotNetSuffix] = $DotNetSuffix";
+Write-Host "[DotNetExtension] = $DotNetExtension";
+Write-Host "[DotNetInstallUrl] = $DotNetInstallUrl";
+Write-Host "[DotNetInstallExtension] = $DotNetInstallExtension";
+Write-Host "[DotNetDirectory] = $DotNetDirectory";
+Write-Host "[DotNetVersionDirectory] = $DotNetVersionDirectory";
+Write-Host "[env:DOTNET_EXE] = $env:DOTNET_EXE";
+Write-Host "[env:DOTNET_ROOT] = $env:DOTNET_ROOT";
+Write-Host "[env:PATH] = $env:PATH";
+
+try{
+ ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile -c Release /nodeReuse:false }
+ ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile -c Release --no-build -- $BuildArguments }
+}finally{
+ ExecSafe { & $env:DOTNET_EXE build-server shutdown --msbuild --vbcscompiler}
+}
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..a020512
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,33 @@
+
+
+ latest
+ false
+ false
+ true
+ true
+
+
+
+
+ Copyright 2020
+ Beffyman
+ git
+ https://github.com/Beffyman/AspNetCore.Client
+ false
+ LICENSE.txt
+ snupkg
+ true
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
+
+
diff --git a/GitVersion.yml b/GitVersion.yml
new file mode 100644
index 0000000..c1a0dc7
--- /dev/null
+++ b/GitVersion.yml
@@ -0,0 +1 @@
+mode: ContinuousDeployment
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
index e5083db..86e4ef0 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2018 Beffyman
+Copyright (c) 2020 Beffyman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/NuGet.config b/NuGet.config
deleted file mode 100644
index 0c1532a..0000000
--- a/NuGet.config
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index d1bdc8d..8dac77b 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-# AspNetCore.Client
-[![AppVeyor](https://ci.appveyor.com/api/projects/status/984mqqfnwytd3oga?svg=true)](https://ci.appveyor.com/project/Beffyman/aspnetcore-client)
+# Beffyman.AspNetCore.Client
+[![Build Status](https://dev.azure.com/beffyman/Beffyman.Github/_apis/build/status/Beffyman.AspNetCore.Client?branchName=master)](https://dev.azure.com/beffyman/Beffyman.Github/_build/latest?definitionId=7&branchName=master)
---
If you are anything like me, you look at
@@ -17,7 +17,7 @@ and think the following
- How can I pool the HttpClient usage?
- HttpClient is injected! Which allows you to control it's lifecycle
- Yuck, hard coded routes, these can lead to issues if my endpoint is still under development.
- - Generated On Build! AspNetCore.Client.Generator is a before compile build task that will generate clients inside the project that implements it.
+ - Generated On Build! Beffyman.AspNetCore.Client.Generator is a before compile build task that will generate clients inside the project that implements it.
- How do I unit test this without spinning up a full web app?
- Works with Microsoft.AspNetCore.TestHost!
- CancellationTokens are not respected inside the TestServer without some hacks though *(registering a kill of the server)* due to the Token not being checked.
@@ -29,27 +29,34 @@ and think the following
- What if sometimes I want to intercept requests before they go out?
- IHttpOverride! Which allows for potential cache interception of requests.
- If I own the endpoint's code, why can't I just generate clients from it to make interacting with it as simple as injecting it?
- - Introducing AspNetCore.Client.Generator!
+ - Introducing Beffyman.AspNetCore.Client.Generator!
[First Time Setup](https://github.com/Beffyman/AspNetCore.Client/wiki/First-Time-Setup)
## Supported Frameworks
-- AspNetCore 2.2 HTTP Controllers
-- AspNetCore 2.2 SignalR Hubs
-- Http Trigger Azure Functions v2
+- AspNetCore 3.1 HTTP Controllers
+- AspNetCore 3.1 SignalR Hubs
+- AspNetCore 3.1 Blazor Client Side
+- Http Trigger Azure Functions v3
-## AspNetCore.Client
-[![NuGet](https://img.shields.io/nuget/v/AspNetCore.Client.svg)](https://www.nuget.org/packages/AspNetCore.Client)
+## Beffyman.AspNetCore.Client
+[![NuGet](https://img.shields.io/nuget/v/Beffyman.AspNetCore.Client.svg)](https://www.nuget.org/packages/Beffyman.AspNetCore.Client)
Includes ServiceCollection registration logic, used on the Client
-## AspNetCore.Server
-[![NuGet](https://img.shields.io/nuget/v/AspNetCore.Server.svg)](https://www.nuget.org/packages/AspNetCore.Server)
+## Beffyman.AspNetCore.Client.Generator
+[![NuGet](https://img.shields.io/nuget/v/Beffyman.AspNetCore.Client.Generator.svg)](https://www.nuget.org/packages/Beffyman.AspNetCore.Client.Generator)
+
+On Build generator that will generate a Clients.cs file based on the Properties in the csproj.
+
+
+## Beffyman.AspNetCore.Server
+[![NuGet](https://img.shields.io/nuget/v/Beffyman.AspNetCore.Server.svg)](https://www.nuget.org/packages/Beffyman.AspNetCore.Server)
Includes attributes that can affect generation, used on your AspNetCore api app
-## AspNetCore.Client.Protobuf
-[![NuGet](https://img.shields.io/nuget/v/AspNetCore.Client.Protobuf.svg)](https://www.nuget.org/packages/AspNetCore.Client.Protobuf)
+## Beffyman.AspNetCore.Client.Protobuf
+[![NuGet](https://img.shields.io/nuget/v/Beffyman.AspNetCore.Client.Protobuf.svg)](https://www.nuget.org/packages/Beffyman.AspNetCore.Client.Protobuf)
Contains a protobuf serializer which can override the default json one via the UseProtobufSerlaizer on the ClientConfiguration.
@@ -64,11 +71,13 @@ services.AddTestWebClients(config=>
```
-## AspNetCore.Client.MessagePack
-[![NuGet](https://img.shields.io/nuget/v/AspNetCore.Client.MessagePack.svg)](https://www.nuget.org/packages/AspNetCore.Client.MessagePack)
+## Beffyman.AspNetCore.Client.MessagePack
+[![NuGet](https://img.shields.io/nuget/v/Beffyman.AspNetCore.Client.MessagePack.svg)](https://www.nuget.org/packages/Beffyman.AspNetCore.Client.MessagePack)
Contains a MessagePack serializer which can override the default json one via the UseMessagePackSerializer on the ClientConfiguration.
+Requires version 1.7.3.7 at the moment due to https://github.com/dotnet/aspnetcore/issues/18074
+
```c#
services.AddTestWebClients(config=>
{
@@ -80,40 +89,31 @@ services.AddTestWebClients(config=>
```
-## AspNetCore.Client.BlazorJson
-[![NuGet](https://img.shields.io/nuget/v/AspNetCore.Client.BlazorJson.svg)](https://www.nuget.org/packages/AspNetCore.Client.BlazorJson)
+## Beffyman.AspNetCore.Client.NewtonsoftJson
+[![NuGet](https://img.shields.io/nuget/v/Beffyman.AspNetCore.Client.NewtonsoftJson.svg)](https://www.nuget.org/packages/Beffyman.AspNetCore.Client.NewtonsoftJson)
-Contains a blazor simpleJson serializer which can override the default json one via the UseBlazorSimpleJsonSerlaizer on the ClientConfiguration.
+Contains a Newtonsoft Json serializer which can override the default json one via the UseNewtonsoftJsonHttpSerializer on the ClientConfiguration.
```c#
-services.AddTestBlazorClients(config=>
+services.AddTestWebClients(config=>
{
- config.UseBlazorSimpleJsonSerlaizer()
- .UseBlazorSimpleJsonDeserlaizer()
- .WithJsonBody()
- .UseExistingHttpClient();
+ config.UseNewtonsoftJsonHttpSerializer()
+ .UseNewtonsoftJsonHttpDeserializer()
+ .WithJsonBody();
});
```
-## AspNetCore.Client.JSInterop
-[![NuGet](https://img.shields.io/nuget/v/AspNetCore.Client.JSInterop.svg)](https://www.nuget.org/packages/AspNetCore.Client.JSInterop)
+## Beffyman.AspNetCore.Client.Http
+[![NuGet](https://img.shields.io/nuget/v/Beffyman.AspNetCore.Client.Http.svg)](https://www.nuget.org/packages/Beffyman.AspNetCore.Client.Http)
-Contains a preview js interop simpleJson serializer which can override the default json one via the UseJSInteropJsonSerializer on the ClientConfiguration.
+Uses Microsoft.Extensions.Http to inject a client factory. This allows for better reuse of the underlying HttpMessageHandler.
```c#
-services.AddTestRazorComponentsClients(config=>
+services.AddTestWebClients(config=>
{
- config.UseJSInteropJsonSerializer()
- .UseJSInteropJsonDeserializer()
- .WithJsonBody();
+ config.UseHttpClientFactory();
});
-```
-
-
-## AspNetCore.Client.Generator
-[![NuGet](https://img.shields.io/nuget/v/AspNetCore.Client.Generator.svg)](https://www.nuget.org/packages/AspNetCore.Client.Generator)
-
-On Build generator that will generate a Clients.cs file based on the Properties in the csproj.
+```
\ No newline at end of file
diff --git a/after.AspNetCore.Client.sln.targets b/after.AspNetCore.Client.sln.targets
deleted file mode 100644
index cd5bcd7..0000000
--- a/after.AspNetCore.Client.sln.targets
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index ecf68be..0000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-version: '0.19.1+{build}'
-configuration: Release
-image: Visual Studio 2017
-
-clone_depth: 1
-
-nuget:
- account_feed: true
- project_feed: true
- disable_publish_on_pr: true
-
-dotnet_csproj:
- patch: true
- file: '**\*.csproj'
- version: '{version}'
-
-install:
-- ps: dotnet restore -s "https://api.nuget.org/v3/index.json" --verbosity m
-
-after_build:
-- ps: ./Build.ps1
-
-artifacts:
- - path: '**\*.nupkg'
-
-deploy:
- - provider: NuGet
- api_key:
- secure: /94KlcfrZ7Y+6+XcDU62slu43dotBG3MMvpH0yk0LqTLdQWaed62SGVB2sQD+K4p
- skip_symbols: false
- artifact: /.*\.nupkg/
- on:
- branch: master
- appveyor_repo_tag: true
-
- - provider: GitHub
- artifact: /.*\.nupkg/ # upload all NuGet packages to release assets
- draft: false
- prerelease: false
- auth_token:
- secure: ciT780F14J207Y8r947Il6TBZQG8xJfvYqOZaU+EsBhDzzzN/sdtETKju59U6hbs
- on:
- branch: master # release from master branch only
- appveyor_repo_tag: true
\ No newline at end of file
diff --git a/artifacts/.include b/artifacts/.include
deleted file mode 100644
index e69de29..0000000
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 0000000..c7ce0f1
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,68 @@
+# ASP.NET Core
+# Build and test ASP.NET Core projects targeting .NET Core.
+# Add steps that run tests, create a NuGet package, deploy, and more:
+# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
+
+trigger:
+- master
+- refs/tags/*
+- feature/*
+
+pr:
+ autoCancel: true
+ branches:
+ include:
+ - master
+ paths:
+ include:
+ - src/*
+ - tests/*
+
+pool:
+ vmImage: 'windows-latest'
+
+variables:
+ buildConfiguration: 'Release'
+
+steps:
+- task: UseDotNet@2
+ inputs:
+ installationPath: "$(Build.SourcesDirectory)/.tmp/dotnet-win"
+ packageType: 'sdk'
+ useGlobalJson: true
+
+#https://github.com/dotnet/cli/issues/6589
+- task: PowerShell@2
+ displayName: 'Run CI'
+ inputs:
+ targetType: filePath
+ filePath: Build.ps1
+ arguments: -target CI
+ failOnStderr: true
+ workingDirectory: $(Build.SourcesDirectory)
+ env:
+ DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR: "$(Build.SourcesDirectory)/.tmp/dotnet-win"
+ DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR: "$(Build.SourcesDirectory)/.tmp/dotnet-win"
+ DOTNET_ROOT: "$(Build.SourcesDirectory)/.tmp/dotnet-win"
+
+- task: PublishTestResults@2
+ displayName: 'Publish Test results'
+ inputs:
+ testResultsFormat: 'VSTest'
+ testResultsFiles: '*.trx'
+ searchFolder: 'artifacts/tests'
+ condition: always()
+
+- task: PublishCodeCoverageResults@1
+ displayName: 'Publish Code Coverage'
+ inputs:
+ codeCoverageTool: cobertura
+ summaryFileLocation: artifacts/tests/coverage.cobertura.xml
+ reportDirectory: artifacts/tests/Reports
+ failIfCoverageEmpty: true
+
+- task: PublishBuildArtifacts@1
+ displayName: 'Publish Packages'
+ inputs:
+ pathtoPublish: 'artifacts/nuget'
+ artifactName: 'Nuget'
\ No newline at end of file
diff --git a/build/.editorconfig b/build/.editorconfig
new file mode 100644
index 0000000..94be682
--- /dev/null
+++ b/build/.editorconfig
@@ -0,0 +1,10 @@
+[*.cs]
+dotnet_style_qualification_for_field = false:warning
+dotnet_style_qualification_for_property = false:warning
+dotnet_style_qualification_for_method = false:warning
+dotnet_style_qualification_for_event = false:warning
+dotnet_style_require_accessibility_modifiers = never:warning
+
+csharp_style_expression_bodied_properties = true:warning
+csharp_style_expression_bodied_indexers = true:warning
+csharp_style_expression_bodied_accessors = true:warning
diff --git a/build/BuildScripts.cs b/build/BuildScripts.cs
new file mode 100644
index 0000000..2e8133a
--- /dev/null
+++ b/build/BuildScripts.cs
@@ -0,0 +1,172 @@
+using System;
+using System.Linq;
+using Nuke.Common;
+using Nuke.Common.CI;
+using Nuke.Common.CI.AzurePipelines;
+using Nuke.Common.Execution;
+using Nuke.Common.Git;
+using Nuke.Common.ProjectModel;
+using Nuke.Common.Tooling;
+using Nuke.Common.Tools.DotNet;
+using Nuke.Common.Tools.GitVersion;
+using Nuke.Common.Utilities.Collections;
+using static Nuke.Common.EnvironmentInfo;
+using static Nuke.Common.IO.FileSystemTasks;
+using static Nuke.Common.IO.PathConstruction;
+using static Nuke.Common.Tools.DotNet.DotNetTasks;
+
+[CheckBuildProjectConfigurations(TimeoutInMilliseconds = 5000)]
+[UnsetVisualStudioEnvironmentVariables]
+public class BuildScripts : NukeBuild
+{
+ public static int Main() => Execute(x => x.Build);
+
+ [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
+ readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
+
+ [Solution] readonly Solution Solution;
+ [GitRepository] readonly GitRepository GitRepository;
+ [GitVersion] readonly GitVersion GitVersion;
+ [CI] readonly AzurePipelines AzurePipelines;
+
+ const string SourceFolder = "src";
+ const string TestsFolder = "tests";
+
+ AbsolutePath SourceDirectory => RootDirectory / SourceFolder;
+ AbsolutePath TestsDirectory => RootDirectory / TestsFolder;
+ AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
+ AbsolutePath TestArtifactsDirectory => ArtifactsDirectory / "tests";
+ AbsolutePath NugetDirectory => ArtifactsDirectory / "nuget";
+ AbsolutePath CodeCoverageReportOutput => TestArtifactsDirectory / "Reports";
+ AbsolutePath CodeCoverageFile => TestArtifactsDirectory / "coverage.cobertura.xml";
+
+
+ RelativePath TestGeneratorProject => (RelativePath)TestsFolder / "Beffyman.AspNetCore.Client.Test.Generator" / "Beffyman.AspNetCore.Client.Test.Generator.csproj";
+ RelativePath GeneratorProject => (RelativePath)SourceFolder / "Beffyman.AspNetCore.Client.Generator" / "Beffyman.AspNetCore.Client.Generator.csproj";
+
+ const string TestGeneratorFramework = "netcoreapp3.1";
+
+ private void CleanArtifacts(bool packages = true)
+ {
+ SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
+ TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
+
+ if (packages)
+ {
+ EnsureCleanDirectory(ArtifactsDirectory);
+ }
+ }
+
+ Target Clean => _ => _
+ .Before(Restore)
+ .Executes(() =>
+ {
+ CleanArtifacts();
+ });
+
+ Target Restore => _ => _
+ .Executes(() =>
+ {
+ DotNetRestore(s => s
+ .SetProjectFile(Solution));
+ });
+
+ Target Build => _ => _
+ .DependsOn(Restore)
+ .Executes(() =>
+ {
+ DotNetBuild(s => s
+ .SetProjectFile(Solution)
+ .SetConfiguration(Configuration)
+ .SetAssemblyVersion(GitVersion.AssemblySemVer)
+ .SetFileVersion(GitVersion.AssemblySemFileVer)
+ .SetInformationalVersion(GitVersion.InformationalVersion)
+ .EnableNoRestore());
+ });
+
+ private void RunTests()
+ {
+ DotNetTest(s => s.SetConfiguration(Configuration)
+ .EnableNoBuild()
+ .EnableNoRestore()
+ .SetLogger("trx")
+ .SetResultsDirectory(TestArtifactsDirectory)
+ .SetLogOutput(true)
+ .SetArgumentConfigurator(arguments => arguments.Add("/p:CollectCoverage={0}", "true")
+ .Add("/p:CoverletOutput={0}/", TestArtifactsDirectory)
+ //.Add("/p:Threshold={0}", 90)
+ .Add("/p:Exclude=\"[xunit*]*%2c[*.Tests]*\"")
+ .Add("/p:UseSourceLink={0}", "true")
+ .Add("/p:CoverletOutputFormat={0}", "cobertura"))
+ .SetProjectFile(Solution));
+
+ FileExists(CodeCoverageFile);
+ }
+
+ Target Test => _ => _
+ .DependsOn(Build)
+ .Executes(() =>
+ {
+ RunTests();
+ });
+
+
+ Target Pack => _ => _
+ .DependsOn(Build)
+ .After(Test)
+ .Executes(() =>
+ {
+ DotNetPack(s => s.SetProject(Solution)
+ .SetVersion(GitVersion.NuGetVersionV2)
+ .SetConfiguration(Configuration)
+ .SetAssemblyVersion(GitVersion.AssemblySemVer)
+ .SetFileVersion(GitVersion.AssemblySemFileVer)
+ .SetInformationalVersion(GitVersion.InformationalVersion)
+ .SetOutputDirectory(NugetDirectory));
+ });
+
+ Target GenerateTestProjectClients => _ => _
+ .DependsOn(Build)
+ .Before(Test)
+ .Executes(() =>
+ {
+ DotNetRun(s => s.SetProjectFile(TestGeneratorProject)
+ .SetConfiguration(Configuration)
+ .SetFramework(TestGeneratorFramework)
+ .EnableNoBuild());
+ });
+
+ Target BuildWithGenerator => _ => _
+ .After(Pack)
+ .Executes(() =>
+ {
+ CleanArtifacts(false);
+
+ DotNetBuild(s => s
+ .SetProjectFile(Solution)
+ .SetConfiguration(Configuration)
+ .SetAssemblyVersion(GitVersion.AssemblySemVer)
+ .SetFileVersion(GitVersion.AssemblySemFileVer)
+ .SetInformationalVersion(GitVersion.InformationalVersion)
+ .EnableNoCache()
+ .AddProperty("GenerateWithNuget", "true")
+ .AddProperty("GeneratorVersion", GitVersion.NuGetVersionV2)
+ .AddSources(NugetDirectory));
+
+ RunTests();
+ });
+
+ Target CI => _ => _
+ .DependsOn(Clean)
+ .DependsOn(Build)
+ .DependsOn(GenerateTestProjectClients)
+ .DependsOn(Test)
+ .DependsOn(Pack)
+ .DependsOn(BuildWithGenerator)
+ .Executes(() =>
+ {
+ AzurePipelines?.UpdateBuildNumber(GitVersion.NuGetVersionV2);
+ });
+
+
+}
diff --git a/build/_build.csproj b/build/_build.csproj
new file mode 100644
index 0000000..3a0d154
--- /dev/null
+++ b/build/_build.csproj
@@ -0,0 +1,40 @@
+
+
+
+ Exe
+ netcoreapp3.0
+ false
+
+ False
+ CS0649;CS0169
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/_build.csproj.DotSettings b/build/_build.csproj.DotSettings
new file mode 100644
index 0000000..96e392e
--- /dev/null
+++ b/build/_build.csproj.DotSettings
@@ -0,0 +1,23 @@
+
+ False
+ Implicit
+ Implicit
+ ExpressionBody
+ 0
+ NEXT_LINE
+ True
+ False
+ 120
+ IF_OWNER_IS_SINGLE_LINE
+ WRAP_IF_LONG
+ False
+ <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
+ <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
diff --git a/global.json b/global.json
index 224a5e8..27eb78f 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "2.2.102"
+ "version": "3.1.100"
}
}
\ No newline at end of file
diff --git a/src/AspNetCore.Client.BlazorJson/AspNetCore.Client.BlazorJson.csproj b/src/AspNetCore.Client.BlazorJson/AspNetCore.Client.BlazorJson.csproj
deleted file mode 100644
index 91fe1b6..0000000
--- a/src/AspNetCore.Client.BlazorJson/AspNetCore.Client.BlazorJson.csproj
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- netstandard2.0
- PackageReference
- true
- false
- true
- latest
- true
- bin\$(Configuration)\$(TargetFramework)\AspNetCore.Client.BlazorJson.xml
-
-
-
- Copyright 2018
- Beffyman
- Contains Blazor SimpleJson serializer for AspNetCore.Client.Generator clients
- git
- https://github.com/Beffyman/AspNetCore.Client
- false
-
- true
- true
- LICENSE.txt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AspNetCore.Client.BlazorJson/BlazorJsonInstaller.cs b/src/AspNetCore.Client.BlazorJson/BlazorJsonInstaller.cs
deleted file mode 100644
index ad9968d..0000000
--- a/src/AspNetCore.Client.BlazorJson/BlazorJsonInstaller.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using AspNetCore.Client.Serializers;
-
-namespace AspNetCore.Client
-{
- ///
- /// Static extension class for the AspnetCore.Client.BlazorJson library
- ///
- public static class BlazorJsonInstaller
- {
- ///
- /// Uses to serialize requests
- ///
- ///
- public static ClientConfiguration UseBlazorSimpleJsonSerializer(this ClientConfiguration config)
- {
- return config.UseSerializer();
- }
-
- ///
- /// Uses to deserialize requests when Json is detected
- ///
- ///
- ///
- public static ClientConfiguration UseBlazorSimpleJsonDeserializer(this ClientConfiguration config)
- {
- return config.UseDeserializer();
- }
- }
-}
diff --git a/src/AspNetCore.Client.BlazorJson/BlazorSimpleJsonSerializer.cs b/src/AspNetCore.Client.BlazorJson/BlazorSimpleJsonSerializer.cs
deleted file mode 100644
index ae2d513..0000000
--- a/src/AspNetCore.Client.BlazorJson/BlazorSimpleJsonSerializer.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.JSInterop;
-
-namespace AspNetCore.Client.Serializers
-{
- ///
- /// Uses Blazor's SimpleJson for serializing and deserializing the http content
- ///
- internal class BlazorSimpleJsonSerializer : IHttpContentSerializer
- {
- internal static readonly string CONTENT_TYPE = "application/json";
- internal static readonly string PROBLEM_TYPE = "application/problem+json";
- public string[] ContentTypes => new string[] { CONTENT_TYPE, PROBLEM_TYPE };
-
- private static readonly IDictionary> _knownJsonPrimitives = new Dictionary>
- {
- { typeof(char), (_)=> char.Parse(_) },
- { typeof(byte), (_)=> byte.Parse(_) },
- { typeof(sbyte), (_)=> sbyte.Parse(_) },
- { typeof(ushort), (_)=> ushort.Parse(_) },
- { typeof(int), (_)=> int.Parse(_) },
- { typeof(uint), (_)=> uint.Parse(_) },
- { typeof(long), (_)=> long.Parse(_) },
- { typeof(ulong), (_)=> ulong.Parse(_) },
- { typeof(float), (_)=> float.Parse(_) },
- { typeof(double), (_)=> double.Parse(_) },
- { typeof(string), (_)=> _.TrimStart('"').TrimEnd('"') },
- { typeof(bool), (_)=> bool.Parse(_) },
- { typeof(DateTime), (_)=> DateTime.Parse(_.TrimStart('"').TrimEnd('"')) },
- { typeof(DateTimeOffset), (_)=> DateTime.Parse(_.TrimStart('"').TrimEnd('"')) },
- { typeof(Guid), (_)=> Guid.Parse(_.TrimStart('"').TrimEnd('"')) },
- };
-
-
- ///
- /// Deserializes the request content which is assumed to be simpleJson into a object of
- ///
- ///
- ///
- ///
- public async Task Deserialize(HttpContent content)
- {
- if (_knownJsonPrimitives.ContainsKey(typeof(T)))
- {
- return (T)_knownJsonPrimitives[typeof(T)](await content.ReadAsStringAsync().ConfigureAwait(false));
- }
- else
- {
- //Can't use the same stream reading as AspNetCore.Client.Serializers.JsonHttpSerializer because Blazor's json doesn't expose those AFAIK
- var str = await content.ReadAsStringAsync().ConfigureAwait(false);
- return Json.Deserialize(str);
- }
- }
-
- ///
- /// Serializes the request into a StringContent with a json media type, but serialized with SimpleJson
- ///
- ///
- ///
- ///
- public HttpContent Serialize(T request)
- {
- //Can't use the same stream writing as AspNetCore.Client.Serializers.JsonHttpSerializer because Blazor's json doesn't expose those AFAIK
-
- var json = Json.Serialize(request);
- return new StringContent(json, Encoding.UTF8, CONTENT_TYPE);
- }
- }
-}
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCore.Client.Generator.Framework.csproj b/src/AspNetCore.Client.Generator.Framework/AspNetCore.Client.Generator.Framework.csproj
deleted file mode 100644
index 468796e..0000000
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCore.Client.Generator.Framework.csproj
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- netstandard2.0
- PackageReference
- true
- false
- true
- latest
- true
- bin\$(Configuration)\$(TargetFramework)\AspNetCore.Client.Generator.Framework.xml
- false
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/HostJson.cs b/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/HostJson.cs
deleted file mode 100644
index 3ac66c6..0000000
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/HostJson.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions
-{
- public class HostJson
- {
- public Http http { get; set; }
- }
-
- public class Http
- {
- public string routePrefix { get; set; }
- }
-
-}
diff --git a/src/AspNetCore.Client.Generator.Framework/RequestModifiers/IRequestModifier.cs b/src/AspNetCore.Client.Generator.Framework/RequestModifiers/IRequestModifier.cs
deleted file mode 100644
index 336b3ac..0000000
--- a/src/AspNetCore.Client.Generator.Framework/RequestModifiers/IRequestModifier.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using AspNetCore.Client.Generator.Framework.Navigation;
-
-namespace AspNetCore.Client.Generator.Framework.RequestModifiers
-{
- ///
- /// Applies a Flurl modification to the request
- ///
- public interface IRequestModifier : INavNode
- {
-
- }
-}
diff --git a/src/AspNetCore.Client.Generator/Json/HostJsonFile.cs b/src/AspNetCore.Client.Generator/Json/HostJsonFile.cs
deleted file mode 100644
index cd7bb4f..0000000
--- a/src/AspNetCore.Client.Generator/Json/HostJsonFile.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Newtonsoft.Json;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
-
-namespace AspNetCore.Client.Generator.Json
-{
- public class HostJsonFile
- {
- public HostJson Data { get; }
-
- private readonly static JsonSerializerSettings _settings = new JsonSerializerSettings
- {
- MissingMemberHandling = MissingMemberHandling.Ignore
- };
-
- public HostJsonFile(string filePath)
- {
- var fileText = Helpers.SafelyReadFromFile(filePath);
-
-
- Data = JsonConvert.DeserializeObject(fileText, _settings);
- }
- }
-
-
-
-}
diff --git a/src/AspNetCore.Client.JSInterop/AspNetCore.Client.JSInterop.csproj b/src/AspNetCore.Client.JSInterop/AspNetCore.Client.JSInterop.csproj
deleted file mode 100644
index e606881..0000000
--- a/src/AspNetCore.Client.JSInterop/AspNetCore.Client.JSInterop.csproj
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- netstandard2.0
- PackageReference
- true
- false
- true
- latest
- true
- bin\$(Configuration)\$(TargetFramework)\AspNetCore.Client.BlazorJson.xml
-
-
-
- Copyright 2018
- Beffyman
- Contains Microsoft.JSInterop SimpleJson serializer for AspNetCore.Client.Generator clients
- git
- https://github.com/Beffyman/AspNetCore.Client
- false
-
- true
- true
- LICENSE.txt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AspNetCore.Client.JSInterop/JSInteropInstaller.cs b/src/AspNetCore.Client.JSInterop/JSInteropInstaller.cs
deleted file mode 100644
index 37f21ac..0000000
--- a/src/AspNetCore.Client.JSInterop/JSInteropInstaller.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using AspNetCore.Client.Serializers;
-
-namespace AspNetCore.Client
-{
- ///
- /// Static extension class for the AspNetCore.Client.JSInterop library
- ///
- public static class JSInteropInstaller
- {
- ///
- /// Uses to serialize requests
- ///
- ///
- public static ClientConfiguration UseJSInteropJsonSerializer(this ClientConfiguration config)
- {
- return config.UseSerializer();
- }
-
- ///
- /// Uses to deserialize requests when Json is detected
- ///
- ///
- ///
- public static ClientConfiguration UseJSInteropJsonDeserializer(this ClientConfiguration config)
- {
- return config.UseDeserializer();
- }
- }
-}
diff --git a/src/AspNetCore.Client.MessagePack/AspNetCore.Client.MessagePack.csproj b/src/AspNetCore.Client.MessagePack/AspNetCore.Client.MessagePack.csproj
deleted file mode 100644
index af663bd..0000000
--- a/src/AspNetCore.Client.MessagePack/AspNetCore.Client.MessagePack.csproj
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- netstandard2.0
- PackageReference
- true
- false
- true
- latest
- true
- bin\$(Configuration)\$(TargetFramework)\AspNetCore.Client.MessagePack.xml
-
-
-
- Copyright 2018
- Beffyman
- Contains MessagePack serializer for AspNetCore.Client.Generator clients
- git
- https://github.com/Beffyman/AspNetCore.Client
- false
-
- true
- true
- LICENSE.txt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AspNetCore.Client.Protobuf/AspNetCore.Client.Protobuf.csproj b/src/AspNetCore.Client.Protobuf/AspNetCore.Client.Protobuf.csproj
deleted file mode 100644
index cd9907b..0000000
--- a/src/AspNetCore.Client.Protobuf/AspNetCore.Client.Protobuf.csproj
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- netstandard2.0
- PackageReference
- true
- false
- true
- latest
- true
- bin\$(Configuration)\$(TargetFramework)\AspNetCore.Client.Protobuf.xml
-
-
-
- Copyright 2018
- Beffyman
- Contains protobuf serializer for AspNetCore.Client.Generator clients
- git
- https://github.com/Beffyman/AspNetCore.Client
- false
-
- true
- true
- LICENSE.txt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AspNetCore.Client/.editorconfig b/src/AspNetCore.Client/.editorconfig
deleted file mode 100644
index d4c1808..0000000
--- a/src/AspNetCore.Client/.editorconfig
+++ /dev/null
@@ -1,75 +0,0 @@
-# You can modify the rules from these initially generated values to suit your own policies
-# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
-[*.cs]
-
-#Core editorconfig formatting - indentation
-
-#use hard tabs for indentation
-indent_style = tab
-
-#Formatting - new line options
-
-#require braces to be on a new line for types, methods, object_collection, control_blocks, and lambdas (also known as "Allman" style)
-csharp_new_line_before_open_brace = types, methods, object_collection, control_blocks, lambdas
-
-#Formatting - organize using options
-
-#sort System.* using directives alphabetically, and place them before other usings
-dotnet_sort_system_directives_first = true
-
-#Formatting - spacing options
-
-#require NO space between a cast and the value
-csharp_space_after_cast = false
-#require a space before the colon for bases or interfaces in a type declaration
-csharp_space_after_colon_in_inheritance_clause = true
-#require a space before the colon for bases or interfaces in a type declaration
-csharp_space_before_colon_in_inheritance_clause = true
-#remove space within empty argument list parentheses
-csharp_space_between_method_call_empty_parameter_list_parentheses = false
-#remove space between method call name and opening parenthesis
-csharp_space_between_method_call_name_and_opening_parenthesis = false
-#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
-csharp_space_between_method_call_parameter_list_parentheses = false
-#remove space within empty parameter list parentheses for a method declaration
-csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
-#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
-csharp_space_between_method_declaration_parameter_list_parentheses = false
-
-#Formatting - wrapping options
-
-#leave code block on single line
-csharp_preserve_single_line_blocks = true
-
-#Style - expression bodied member options
-
-#prefer block bodies for constructors
-csharp_style_expression_bodied_constructors = false:suggestion
-#prefer block bodies for methods
-csharp_style_expression_bodied_methods = false:suggestion
-
-#Style - expression level options
-
-#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
-dotnet_style_predefined_type_for_member_access = true:suggestion
-
-#Style - implicit and explicit types
-
-#prefer var is used to declare variables with built-in system types such as int
-csharp_style_var_for_built_in_types = true:suggestion
-#prefer var when the type is already mentioned on the right-hand side of a declaration expression
-csharp_style_var_when_type_is_apparent = true:suggestion
-
-#Style - language keyword and framework type options
-
-#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
-dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
-
-#Style - qualification options
-
-#prefer fields not to be prefaced with this. or Me. in Visual Basic
-dotnet_style_qualification_for_field = false:suggestion
-#prefer methods to be prefaced with this. in C# or Me. in Visual Basic
-dotnet_style_qualification_for_method = true:suggestion
-#prefer properties not to be prefaced with this. or Me. in Visual Basic
-dotnet_style_qualification_for_property = false:suggestion
diff --git a/src/AspNetCore.Client/AspNetCore.Client.csproj b/src/AspNetCore.Client/AspNetCore.Client.csproj
deleted file mode 100644
index ed89745..0000000
--- a/src/AspNetCore.Client/AspNetCore.Client.csproj
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- netstandard2.0
- PackageReference
- true
- false
- true
- latest
- true
- bin\$(Configuration)\$(TargetFramework)\AspNetCore.Client.xml
-
-
-
- Copyright 2018
- Beffyman
- Implements registration of clients into a ServiceCollection
- git
- https://github.com/Beffyman/AspNetCore.Client
- false
-
- true
- true
- LICENSE.txt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AspNetCore.Server/AspNetCore.Server.csproj b/src/AspNetCore.Server/AspNetCore.Server.csproj
deleted file mode 100644
index dcee7c3..0000000
--- a/src/AspNetCore.Server/AspNetCore.Server.csproj
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
- netstandard2.0
- PackageReference
- true
- false
- true
- latest
- true
- bin\$(Configuration)\$(TargetFramework)\AspNetCore.Server.xml
-
-
-
- Copyright 2018
- Beffyman
- A helper package for AspNetCore.Client.Generator that contains known attributes that affect the generation
- git
- https://github.com/Beffyman/AspNetCore.Client
- false
-
- true
- true
- LICENSE.txt
-
-
-
-
-
-
diff --git a/src/AspNetCore.Client.Generator/.editorconfig b/src/Beffyman.AspNetCore.Client.Generator.Framework/.editorconfig
similarity index 88%
rename from src/AspNetCore.Client.Generator/.editorconfig
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/.editorconfig
index 7d5ba78..89aea01 100644
--- a/src/AspNetCore.Client.Generator/.editorconfig
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/.editorconfig
@@ -1,4 +1,4 @@
-# Rules in this file were initially inferred by Visual Studio IntelliCode from the E:\Git_Github\AspNetCore.Client\src\AspNetCore.Client.BlazorJson\ codebase based on best match to current usage at 10/25/2018
+# Rules in this file were initially inferred by Visual Studio IntelliCode from the E:\Git_Github\Beffyman.AspNetCore.Client\src\Beffyman.AspNetCore.Client.BlazorJson\ codebase based on best match to current usage at 10/25/2018
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs]
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpController.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpController.cs
similarity index 93%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpController.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpController.cs
index af54ffc..16b3519 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpController.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpController.cs
@@ -2,15 +2,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
-using AspNetCore.Client.Generator.Framework.AttributeInterfaces;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
using AspNetCore.Server.Attributes.Http;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp
{
///
/// Information about a group of endpoints used for generation
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpEndpoint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpEndpoint.cs
similarity index 93%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpEndpoint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpEndpoint.cs
index 840cc6a..44b7b72 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpEndpoint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/AspNetCoreHttpEndpoint.cs
@@ -2,17 +2,17 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
-using AspNetCore.Client.Generator.Framework.AttributeInterfaces;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
+using Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
using AspNetCore.Server.Attributes.Http;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp
{
///
/// The information about an endpoint used for generation
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/ClientDependency.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/ClientDependency.cs
similarity index 94%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/ClientDependency.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/ClientDependency.cs
index 11d7eb3..90bd555 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/ClientDependency.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/ClientDependency.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
{
///
/// Dependency that handles the generated client wrapper
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpOverrideDependency.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpOverrideDependency.cs
similarity index 90%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpOverrideDependency.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpOverrideDependency.cs
index 87016c9..12e9692 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpOverrideDependency.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpOverrideDependency.cs
@@ -1,6 +1,6 @@
-using AspNetCore.Client.Http;
+using Beffyman.AspNetCore.Client.Http;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
{
///
/// Injection for
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpSerializerDependency.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpSerializerDependency.cs
similarity index 90%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpSerializerDependency.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpSerializerDependency.cs
index 9d9507d..3c03e92 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpSerializerDependency.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/HttpSerializerDependency.cs
@@ -1,6 +1,6 @@
-using AspNetCore.Client.Serializers;
+using Beffyman.AspNetCore.Client.Serializers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
{
///
/// Injection for
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/IDependency.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/IDependency.cs
similarity index 91%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/IDependency.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/IDependency.cs
index 62a66db..df660f4 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/IDependency.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/IDependency.cs
@@ -1,4 +1,4 @@
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
{
///
/// Indicates that the class can be injected into the client
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/RequestModifierDependency.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/RequestModifierDependency.cs
similarity index 84%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/RequestModifierDependency.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/RequestModifierDependency.cs
index b030ac5..65e2f25 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/RequestModifierDependency.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Dependencies/RequestModifierDependency.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
-using AspNetCore.Client.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.RequestModifiers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies
{
///
/// Injection for
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/FunctionEndpoint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/FunctionEndpoint.cs
similarity index 90%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/FunctionEndpoint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/FunctionEndpoint.cs
index 34635a1..ec29f06 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/FunctionEndpoint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/FunctionEndpoint.cs
@@ -1,330 +1,332 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net.Http;
-using System.Reflection;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
-using AspNetCore.Client.Generator.Framework.AttributeInterfaces;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
-using AspNetCore.Server.Attributes.Http;
-
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions
-{
- ///
- /// The information about an endpoint used for generation
- ///
- public class FunctionEndpoint : IResponseTypes, IHeaders, IIgnored, IObsolete, INavNode
- {
- ///
- /// Name of the endpoint/controller generated from
- ///
- public string Name { get; set; }
-
- ///
- /// Client name of the function
- ///
- public string ClientName => $"{Name}Client";
-
- ///
- /// Determines whether or not to have a void method depending on if it is a ActionResult return
- ///
- public string ReturnType { get; set; }
-
- ///
- /// Indicates that the endpoint returns a stream and to not deserialize it
- ///
- public bool ReturnsStream { get; set; }
-
- ///
- /// List of response types that can be added to the context
- ///
- public IList ResponseTypes { get; set; } = new List();
-
- ///
- /// List of headers that can be added to the context that never change in value
- ///
- public IList ConstantHeader { get; set; } = new List();
-
- ///
- /// List of headers that can be added to the context that are used as a parameter
- ///
- public IList ParameterHeader { get; set; } = new List();
-
- ///
- /// Parameters that the endpoint has, can be placed in many different locations in a request
- ///
- public IList Parameters { get; set; } = new List();
-
- ///
- /// Parameters specific to a specific http method that is expected
- ///
- public IDictionary> HttpParameters { get; set; } = new Dictionary>();
-
- ///
- /// Supported HttpMethods listed out
- ///
- public IList SupportedMethods { get; set; } = new List();
-
-
- //IRoute
-
- ///
- /// Route required to hit the function, can be null
- ///
- public HttpRoute Route { get; set; }
-
- //IIgnored
-
- ///
- /// Should this endpoint be ignored because it has the
- ///
- public bool Ignored { get; set; }
-
-
- //IObsolete
-
- ///
- /// Whether or not the endpoint is obsolete
- ///
- public bool Obsolete { get; set; }
-
- ///
- /// Message
- ///
- public string ObsoleteMessage { get; set; }
-
- ///
- /// Whether of not the controller loaded correctly
- ///
- public bool Failed { get; set; }
-
- ///
- /// Unexpected error found
- ///
- public bool UnexpectedFailure { get; set; }
-
- ///
- /// Expected error found
- ///
- public string Error { get; set; }
-
- ///
- /// Should this endpoint be generated
- ///
- public bool Generated => !Ignored && !Failed;
-
- ///
- /// Creates an function
- ///
- public FunctionEndpoint()
- {
- }
-
- ///
- /// Retrieve all the implemented children of this node
- ///
- ///
- public IEnumerable GetChildren()
- {
- return Enumerable.Empty()
- .Union(ResponseTypes)
- .Union(ConstantHeader)
- .Union(Parameters)
- .Union(ParameterHeader)
- .Where(x => x != null);
- }
-
- ///
- /// Gets all of the parameters for this function for the httpMethod that is sorted
- ///
- ///
- ///
- public IEnumerable GetParametersForHttpMethod(HttpMethod method)
- {
- return GetChildren().OfType().Union(GetHttpParameters(method)).OrderBy(x => x.DefaultValue == null ? 0 : 1).ThenBy(x => x.SortOrder);
- }
-
- ///
- /// Gets all the parameters of the function for the httpMethod that are not response types, used for creating a Raw request
- ///
- ///
- ///
- public IEnumerable GetParametersWithoutResponseTypesForHttpMethod(HttpMethod method)
- {
- return GetChildren().Where(x => !(x is ResponseType) || (x is ExceptionResponseType)).OfType().Union(GetHttpParameters(method)).OrderBy(x => x.DefaultValue == null ? 0 : 1).ThenBy(x => x.SortOrder);
- }
-
- private IEnumerable GetHttpParameters(HttpMethod method)
- {
- if (HttpParameters.ContainsKey(method))
- {
- return HttpParameters[method];
- }
- else
- {
- return Enumerable.Empty();
- }
- }
-
- ///
- /// Gets all of the parameters that exist inside the route
- ///
- ///
- public IEnumerable GetRouteParameters()
- {
- return GetChildren().OfType().OrderBy(x => x.SortOrder);
- }
-
- ///
- /// Gets all the parameters that exist as query string in the uri
- ///
- ///
- public IEnumerable GetQueryParameters(HttpMethod method)
- {
- return GetChildren().Union(GetHttpParameters(method)).OfType().OrderBy(x => x.SortOrder);
- }
-
-
- ///
- /// Gets the body parameter for the method
- ///
- ///
- public BodyParameter GetBodyParameter(HttpMethod method)
- {
- return GetChildren().Union(GetHttpParameters(method)).OfType().OrderBy(x => x.SortOrder).SingleOrDefault();
- }
-
- ///
- /// Gets all headers that exist as children for the request
- ///
- ///
- public IEnumerable GetHeaders()
- {
- return GetChildren().OfType();
- }
-
- ///
- /// Gets all response types that are associated with the endpoint
- ///
- ///
- public IEnumerable GetResponseTypes()
- {
- return GetChildren().OfType().OrderBy(x => x.SortOrder);
- }
-
- ///
- /// Gets all request modifiers that affect this endpoint
- ///
- ///
- public IEnumerable GetRequestModifiers()
- {
- return GetChildren().OfType();
- }
-
- ///
- /// Full route template for the endpoint
- ///
- public HttpRoute GetFullRoute()
- {
- return Route;
- }
-
- ///
- /// Get all route constraints associated with the endpoint, with the caller being accounted for
- ///
- ///
- public IEnumerable GetRouteConstraints()
- {
- return Route?.Constraints ?? Enumerable.Empty();
- }
-
- ///
- /// Returns a string that represents the current object under the context of the caller
- ///
- ///
- public override string ToString()
- {
- return $"{Name}";
- }
-
- ///
- /// Get the signature of the endpoint, for equality/grouping purposes
- ///
- ///
- ///
- public string GetSignature(HttpMethod method)
- {
- return $"{ToString()}(${string.Join(", ", GetParametersForHttpMethod(method).Select(x => x.ToString()).Where(x => !string.IsNullOrEmpty(x)))}";
- }
-
-
- ///
- /// Validates the endpoint for anything that might lead to a compile or runtime error
- ///
- public void Validate()
- {
- var duplicateResponseTypes = this.GetResponseTypes().Where(x => x.Status != null).GroupBy(x => x.Status).Where(x => x.Count() > 1).ToList();
-
- if (duplicateResponseTypes.Any())
- {
- throw new NotSupportedException($"Endpoint has multiple response types of the same status defined. {string.Join(", ", duplicateResponseTypes.Select(x => x.Key?.ToString()))}");
- }
-
- foreach (var method in SupportedMethods)
- {
- var duplicateParameters = this.GetParametersWithoutResponseTypesForHttpMethod(method).GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
-
- if (duplicateParameters.Any())
- {
- throw new NotSupportedException($"Endpoint has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
- }
- }
-
-
-
- var duplicateHeaders = this.GetHeaders().GroupBy(x => x.Key).Where(x => x.Count() > 1).ToList();
-
- if (duplicateHeaders.Any())
- {
- throw new NotSupportedException($"Endpoint has multiple headers of the same key defined. {string.Join(", ", duplicateHeaders.Select(x => x.Key?.ToString()))}");
- }
- }
-
- private static IEnumerable _allDependencies = typeof(IDependency).GetTypeInfo().Assembly
- .GetTypes()
- .Where(x => typeof(IDependency).IsAssignableFrom(x) && !x.GetTypeInfo().IsAbstract)
- .ToList();
-
- ///
- /// Gets all of the injectable properties for the clients generated
- ///
- ///
- public IEnumerable GetInjectionDependencies()
- {
- return _allDependencies.Where(x => x != typeof(ClientDependency)).Select(x => Activator.CreateInstance(x) as IDependency);
- }
-
- ///
- /// Gets the method's name, if there is only 1 method, use the base name
- ///
- ///
- ///
- public string GetEndpointName(HttpMethod method, bool raw, bool async)
- {
- if (SupportedMethods.Count > 1)
- {
- return $"{Name}{(raw ? "Raw" : string.Empty)}_{method.Method.ToUpper()}{(async ? "Async" : string.Empty)}";
- }
- else
- {
- return $"{Name}{(raw ? "Raw" : string.Empty)}{(async ? "Async" : string.Empty)}";
- }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Reflection;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
+using Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
+using AspNetCore.Server.Attributes.Http;
+
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions
+{
+ ///
+ /// The information about an endpoint used for generation
+ ///
+ public class FunctionEndpoint : IResponseTypes, IHeaders, IIgnored, IObsolete, INavNode
+ {
+ ///
+ /// Name of the endpoint/controller generated from
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// Client name of the function
+ ///
+ public string ClientName => $"{Name}Client";
+
+ ///
+ /// Determines whether or not to have a void method depending on if it is a ActionResult return
+ ///
+ public string ReturnType { get; set; }
+
+ ///
+ /// Indicates that the endpoint returns a stream and to not deserialize it
+ ///
+ public bool ReturnsStream { get; set; }
+
+ ///
+ /// List of response types that can be added to the context
+ ///
+ public IList ResponseTypes { get; set; } = new List();
+
+ ///
+ /// List of headers that can be added to the context that never change in value
+ ///
+ public IList ConstantHeader { get; set; } = new List();
+
+ ///
+ /// List of headers that can be added to the context that are used as a parameter
+ ///
+ public IList ParameterHeader { get; set; } = new List();
+
+ ///
+ /// Parameters that the endpoint has, can be placed in many different locations in a request
+ ///
+ public IList Parameters { get; set; } = new List();
+
+ ///
+ /// Parameters specific to a specific http method that is expected
+ ///
+ public IDictionary> HttpParameters { get; set; } = new Dictionary>();
+
+ ///
+ /// Supported HttpMethods listed out
+ ///
+ public IList SupportedMethods { get; set; } = new List();
+
+
+ //IRoute
+
+ ///
+ /// Route required to hit the function, can be null
+ ///
+ public HttpRoute Route { get; set; }
+
+ //IIgnored
+
+ ///
+ /// Should this endpoint be ignored because it has the
+ ///
+ public bool Ignored { get; set; }
+
+
+ //IObsolete
+
+ ///
+ /// Whether or not the endpoint is obsolete
+ ///
+ public bool Obsolete { get; set; }
+
+ ///
+ /// Message
+ ///
+ public string ObsoleteMessage { get; set; }
+
+ ///
+ /// Whether of not the controller loaded correctly
+ ///
+ public bool Failed { get; set; }
+
+ ///
+ /// Unexpected error found
+ ///
+ public bool UnexpectedFailure { get; set; }
+
+ ///
+ /// Expected error found
+ ///
+ public string Error { get; set; }
+
+ ///
+ /// Should this endpoint be generated
+ ///
+ public bool Generated => !Ignored && !Failed;
+
+ ///
+ /// Creates an function
+ ///
+ public FunctionEndpoint()
+ {
+ }
+
+ ///
+ /// Retrieve all the implemented children of this node
+ ///
+ ///
+ public IEnumerable GetChildren()
+ {
+ return Enumerable.Empty()
+ .Union(ResponseTypes)
+ .Union(ConstantHeader)
+ .Union(Parameters)
+ .Union(ParameterHeader)
+ .Where(x => x != null);
+ }
+
+ ///
+ /// Gets all of the parameters for this function for the httpMethod that is sorted
+ ///
+ ///
+ ///
+ public IEnumerable GetParametersForHttpMethod(HttpMethod method)
+ {
+ return GetChildren().OfType().Union(GetHttpParameters(method)).OrderBy(x => x.DefaultValue == null ? 0 : 1).ThenBy(x => x.SortOrder);
+ }
+
+ ///
+ /// Gets all the parameters of the function for the httpMethod that are not response types, used for creating a Raw request
+ ///
+ ///
+ ///
+ public IEnumerable GetParametersWithoutResponseTypesForHttpMethod(HttpMethod method)
+ {
+ return GetChildren().Where(x => !(x is ResponseType) || (x is ExceptionResponseType)).OfType().Union(GetHttpParameters(method)).OrderBy(x => x.DefaultValue == null ? 0 : 1).ThenBy(x => x.SortOrder);
+ }
+
+ private IEnumerable GetHttpParameters(HttpMethod method)
+ {
+ if (HttpParameters.ContainsKey(method))
+ {
+ return HttpParameters[method];
+ }
+ else
+ {
+ return Enumerable.Empty();
+ }
+ }
+
+ ///
+ /// Gets all of the parameters that exist inside the route
+ ///
+ ///
+ public IEnumerable GetRouteParameters()
+ {
+ return GetChildren().OfType().OrderBy(x => x.SortOrder);
+ }
+
+ ///
+ /// Gets all the parameters that exist as query string in the uri
+ ///
+ ///
+ public IEnumerable GetQueryParameters(HttpMethod method)
+ {
+ return GetChildren().Union(GetHttpParameters(method)).OfType().OrderBy(x => x.SortOrder);
+ }
+
+
+ ///
+ /// Gets the body parameter for the method
+ ///
+ ///
+ public BodyParameter GetBodyParameter(HttpMethod method)
+ {
+ return GetChildren().Union(GetHttpParameters(method)).OfType().OrderBy(x => x.SortOrder).SingleOrDefault();
+ }
+
+ ///
+ /// Gets all headers that exist as children for the request
+ ///
+ ///
+ public IEnumerable GetHeaders()
+ {
+ return GetChildren().OfType();
+ }
+
+ ///
+ /// Gets all response types that are associated with the endpoint
+ ///
+ ///
+ public IEnumerable GetResponseTypes()
+ {
+ return GetChildren().OfType().OrderBy(x => x.SortOrder);
+ }
+
+ ///
+ /// Gets all request modifiers that affect this endpoint
+ ///
+ ///
+ public IEnumerable GetRequestModifiers()
+ {
+ return GetChildren().OfType();
+ }
+
+ ///
+ /// Full route template for the endpoint
+ ///
+ public HttpRoute GetFullRoute()
+ {
+ return Route;
+ }
+
+ ///
+ /// Get all route constraints associated with the endpoint, with the caller being accounted for
+ ///
+ ///
+ public IEnumerable GetRouteConstraints()
+ {
+ return Route?.Constraints ?? Enumerable.Empty();
+ }
+
+ ///
+ /// Returns a string that represents the current object under the context of the caller
+ ///
+ ///
+ public override string ToString()
+ {
+ return $"{Name}";
+ }
+
+ ///
+ /// Get the signature of the endpoint, for equality/grouping purposes
+ ///
+ ///
+ ///
+ public string GetSignature(HttpMethod method)
+ {
+ return $"{ToString()}(${string.Join(", ", GetParametersForHttpMethod(method).Select(x => x.ToString()).Where(x => !string.IsNullOrEmpty(x)))}";
+ }
+
+
+ ///
+ /// Validates the endpoint for anything that might lead to a compile or runtime error
+ ///
+ public void Validate()
+ {
+ var duplicateResponseTypes = this.GetResponseTypes().Where(x => x.Status != null).GroupBy(x => x.Status).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateResponseTypes.Any())
+ {
+ throw new NotSupportedException($"Endpoint has multiple response types of the same status defined. {string.Join(", ", duplicateResponseTypes.Select(x => x.Key?.ToString()))}");
+ }
+
+ foreach (var method in SupportedMethods)
+ {
+ var duplicateParameters = this.GetParametersWithoutResponseTypesForHttpMethod(method).GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateParameters.Any())
+ {
+ throw new NotSupportedException($"Endpoint has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
+ }
+ }
+
+
+
+ var duplicateHeaders = this.GetHeaders().GroupBy(x => x.Key).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateHeaders.Any())
+ {
+ throw new NotSupportedException($"Endpoint has multiple headers of the same key defined. {string.Join(", ", duplicateHeaders.Select(x => x.Key?.ToString()))}");
+ }
+ }
+
+ private static IEnumerable _allDependencies = typeof(IDependency).GetTypeInfo().Assembly
+ .GetTypes()
+ .Where(x => typeof(IDependency).IsAssignableFrom(x) && !x.GetTypeInfo().IsAbstract)
+ .ToList();
+
+ ///
+ /// Gets all of the injectable properties for the clients generated
+ ///
+ ///
+ public IEnumerable GetInjectionDependencies()
+ {
+ return _allDependencies.Where(x => x != typeof(ClientDependency)).Select(x => Activator.CreateInstance(x) as IDependency);
+ }
+
+ ///
+ /// Gets the method's name, if there is only 1 method, use the base name
+ ///
+ ///
+ ///
+ ///
+ ///
+ public string GetEndpointName(HttpMethod method, bool raw, bool async)
+ {
+ if (SupportedMethods.Count > 1)
+ {
+ return $"{Name}{(raw ? "Raw" : string.Empty)}_{method.Method.ToUpper()}{(async ? "Async" : string.Empty)}";
+ }
+ else
+ {
+ return $"{Name}{(raw ? "Raw" : string.Empty)}{(async ? "Async" : string.Empty)}";
+ }
+ }
+ }
+}
diff --git a/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/HostJson.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/HostJson.cs
new file mode 100644
index 0000000..81abcb5
--- /dev/null
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Functions/HostJson.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions
+{
+ ///
+ /// Root Json object for the host.json
+ ///
+ public class HostJson
+ {
+ ///
+ /// Http section
+ ///
+ public Http http { get; set; }
+ }
+
+ ///
+ /// Http section
+ ///
+ public class Http
+ {
+ ///
+ /// Prefix for http requests
+ ///
+ public string routePrefix { get; set; }
+ }
+
+}
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ConstantHeader.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ConstantHeader.cs
similarity index 86%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ConstantHeader.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ConstantHeader.cs
index 7c19fb5..e799271 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ConstantHeader.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ConstantHeader.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
using AspNetCore.Server.Attributes.Http;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
{
///
/// Handles
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/Header.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/Header.cs
similarity index 73%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/Header.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/Header.cs
index 6c60feb..bd25fe8 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/Header.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/Header.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
{
///
/// Contains basic info about a header
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/IHeaders.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/IHeaders.cs
similarity index 86%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/IHeaders.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/IHeaders.cs
index c2b5358..a4cdd28 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/IHeaders.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/IHeaders.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
{
///
/// Detailing that this component contains headers that can be added
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ParameterHeader.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ParameterHeader.cs
similarity index 90%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ParameterHeader.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ParameterHeader.cs
index b0445ce..fa92be9 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ParameterHeader.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Headers/ParameterHeader.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
using AspNetCore.Server.Attributes.Http;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers
{
///
/// Handles
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/BodyParameter.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/BodyParameter.cs
similarity index 90%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/BodyParameter.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/BodyParameter.cs
index e0ef13f..1ea57d9 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/BodyParameter.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/BodyParameter.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters
{
///
/// Parameter for the endpoint parameter that is placed in the request body
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/QueryParameter.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/QueryParameter.cs
similarity index 85%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/QueryParameter.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/QueryParameter.cs
index f6b942e..90206ac 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/QueryParameter.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/QueryParameter.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters
{
///
/// Parameter for the endpoint parameter that is placed in the uri as a query parameter
@@ -33,8 +33,15 @@ public class QueryParameter : IParameter
///
public int SortOrder => 3;
+ ///
+ /// Whether or not the Type is empty
+ ///
public bool IsConstant => string.IsNullOrEmpty(Type);
+ ///
+ /// Default Constructor
+ ///
+ ///
public QueryParameter(string value)
{
Name = value;
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/RouteParameter.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/RouteParameter.cs
similarity index 90%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/RouteParameter.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/RouteParameter.cs
index 7b71680..9c3ae90 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/RouteParameter.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Parameters/RouteParameter.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters
{
///
/// Parameter for the endpoint parameter that is placed in the uri as a route parameter
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/CookieModifier.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/CookieModifier.cs
similarity index 84%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/CookieModifier.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/CookieModifier.cs
index 206b30b..937fb1b 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/CookieModifier.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/CookieModifier.cs
@@ -1,10 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using System.Net;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
{
///
/// Parameter for the additional cookies for the request
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/FunctionAuthModifier.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/FunctionAuthModifier.cs
similarity index 77%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/FunctionAuthModifier.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/FunctionAuthModifier.cs
index a2da548..be42000 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/FunctionAuthModifier.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/FunctionAuthModifier.cs
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
{
+ ///
+ /// Detects whether a authkey was provided for the function
+ ///
public class FunctionAuthModifier : IRequestModifier, IParameter
{
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/HeadersModifier.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/HeadersModifier.cs
similarity index 84%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/HeadersModifier.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/HeadersModifier.cs
index 064d371..0e4daa4 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/HeadersModifier.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/HeadersModifier.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
{
///
/// Parameter for the additional headers for the request
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/SecurityModifier.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/SecurityModifier.cs
similarity index 80%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/SecurityModifier.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/SecurityModifier.cs
index 3ced934..301371b 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/SecurityModifier.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/SecurityModifier.cs
@@ -1,9 +1,9 @@
using System.Collections.Generic;
-using AspNetCore.Client.Authorization;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Authorization;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
{
///
/// Parameter for the security information
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/TimeoutModifier.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/TimeoutModifier.cs
similarity index 83%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/TimeoutModifier.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/TimeoutModifier.cs
index d86fc46..77b0c60 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/TimeoutModifier.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/RequestModifiers/TimeoutModifier.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers
{
///
/// Parameter for the timeout of the request
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ExceptionResponseType.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ExceptionResponseType.cs
similarity index 93%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ExceptionResponseType.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ExceptionResponseType.cs
index 25b073c..ac0b136 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ExceptionResponseType.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ExceptionResponseType.cs
@@ -2,7 +2,7 @@
using System.Net;
using Flurl.Http;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes
{
///
/// Used for the callback for when the http call throws a FlurlHttpException meaning the request didn't get a proper response
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/IResponseTypes.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/IResponseTypes.cs
similarity index 79%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/IResponseTypes.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/IResponseTypes.cs
index 35f9ed6..85c8a0d 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/IResponseTypes.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/IResponseTypes.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes
{
///
/// Detailing that this component contains response types that can be added
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ResponseType.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ResponseType.cs
similarity index 95%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ResponseType.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ResponseType.cs
index aeb3a23..cd37a54 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ResponseType.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/ResponseTypes/ResponseType.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes
{
///
/// Handles mapping ProducesResponseType to a suitable call
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/ApiVersion.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/ApiVersion.cs
similarity index 65%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/ApiVersion.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/ApiVersion.cs
index 1a19b6d..a4baede 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/ApiVersion.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/ApiVersion.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes
{
///
/// Representation of an API version
@@ -19,12 +19,21 @@ public class ApiVersion
///
public bool Query { get; set; }
+ ///
+ /// Default Constructor
+ ///
+ ///
+ ///
public ApiVersion(string version, bool query)
{
Version = version;
Query = query;
}
+ ///
+ /// ToString
+ ///
+ ///
public override string ToString()
{
return Version;
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/AlphaConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/AlphaConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/AlphaConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/AlphaConstraint.cs
index 516abe6..2fc5b2a 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/AlphaConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/AlphaConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// String must consist of one or more alphabetical characters (a-z, case-insensitive)
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/ApiVersionContraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/ApiVersionContraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/ApiVersionContraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/ApiVersionContraint.cs
index 33e77d0..0a7f4ac 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/ApiVersionContraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/ApiVersionContraint.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// RouteConstraint for apiVersioning
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/BoolConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/BoolConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/BoolConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/BoolConstraint.cs
index 9b5cf13..2278117 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/BoolConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/BoolConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Matches true or false (case-insensitive)
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DateTimeConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DateTimeConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DateTimeConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DateTimeConstraint.cs
index 3fb50bc..d179dab 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DateTimeConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DateTimeConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Matches a valid DateTime value (in the invariant culture - see warning)
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DecimalConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DecimalConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DecimalConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DecimalConstraint.cs
index 32fefc2..378c4ce 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DecimalConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/DecimalConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Matches a valid decimal value (in the invariant culture - see warning)
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/FloatConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/FloatConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/FloatConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/FloatConstraint.cs
index 782f44b..cb95bae 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/FloatConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/FloatConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Matches a valid float value (in the invariant culture - see warning)
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/GuidConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/GuidConstraint.cs
similarity index 87%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/GuidConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/GuidConstraint.cs
index c634dc6..e42ee18 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/GuidConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/GuidConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Matches a valid Guid value
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/IntConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/IntConstraint.cs
similarity index 87%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/IntConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/IntConstraint.cs
index e849f64..9a5adb4 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/IntConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/IntConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Matches any integer
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LengthConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LengthConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LengthConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LengthConstraint.cs
index fa91ca7..36daa54 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LengthConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LengthConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// String must be exactly x characters long
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LongConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LongConstraint.cs
similarity index 87%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LongConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LongConstraint.cs
index d8c4089..15f3c5e 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LongConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/LongConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Matches a valid long value
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxConstraint.cs
index 3e28d16..8a5bcce 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Integer value must be no more than x
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxLengthConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxLengthConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxLengthConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxLengthConstraint.cs
index d4e4e9b..00d8302 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxLengthConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MaxLengthConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// String must be no more than x characters
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinConstraint.cs
similarity index 87%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinConstraint.cs
index 38ea527..61b8b46 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Integer value must be at least x
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinLengthConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinLengthConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinLengthConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinLengthConstraint.cs
index e40bfcc..c5a42bb 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinLengthConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/MinLengthConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// String must be at least x characters
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RangeConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RangeConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RangeConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RangeConstraint.cs
index e35d901..3d86b2b 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RangeConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RangeConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Integer value must be at least x but no more than y
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RegexConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RegexConstraint.cs
similarity index 91%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RegexConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RegexConstraint.cs
index 45a86a0..2e0dc20 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RegexConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RegexConstraint.cs
@@ -1,7 +1,7 @@
using System;
using System.Text.RegularExpressions;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// String must match the regular expression
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RequiredConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RequiredConstraint.cs
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RequiredConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RequiredConstraint.cs
index a6bdfc1..eccaff0 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RequiredConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RequiredConstraint.cs
@@ -1,6 +1,6 @@
using System;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Used to enforce that a non-parameter value is present during URL generation
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RouteConstraint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RouteConstraint.cs
similarity index 95%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RouteConstraint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RouteConstraint.cs
index 0975791..4d466e1 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RouteConstraint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/Constraints/RouteConstraint.cs
@@ -4,7 +4,7 @@
using System.Reflection;
using System.Text.RegularExpressions;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints
{
///
/// Base route constraint implementation
diff --git a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/HttpRoute.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/HttpRoute.cs
similarity index 84%
rename from src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/HttpRoute.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/HttpRoute.cs
index b911168..e16fa64 100644
--- a/src/AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/HttpRoute.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AspNetCoreHttp/Routes/HttpRoute.cs
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
using Microsoft.AspNetCore.Routing.Template;
-namespace AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes
{
///
/// Route details
@@ -64,6 +64,10 @@ public HttpRoute(string value)
return parameters;
}
+ ///
+ /// Gets the parameters for the route
+ ///
+ ///
public IDictionary GetRouteParameters()
{
IDictionary parameters = new Dictionary();
@@ -99,11 +103,20 @@ public HttpRoute Merge(HttpRoute route)
};
}
+ ///
+ /// Does the Route contain the provided string?
+ ///
+ ///
+ ///
public bool Contains(string str)
{
return Value?.Contains(str) ?? false;
}
+ ///
+ /// ToString
+ ///
+ ///
public override string ToString()
{
return Value;
diff --git a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IAuthorize.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IAuthorize.cs
similarity index 76%
rename from src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IAuthorize.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IAuthorize.cs
index 954051b..fb09ecf 100644
--- a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IAuthorize.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IAuthorize.cs
@@ -1,4 +1,4 @@
-namespace AspNetCore.Client.Generator.Framework.AttributeInterfaces
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces
{
///
/// Determines if the endpoint requires credentials because AuthorizeAttribute on it
diff --git a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IIgnored.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IIgnored.cs
similarity index 83%
rename from src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IIgnored.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IIgnored.cs
index aab3951..9e22ca6 100644
--- a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IIgnored.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IIgnored.cs
@@ -1,6 +1,6 @@
using AspNetCore.Server.Attributes.Http;
-namespace AspNetCore.Client.Generator.Framework.AttributeInterfaces
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces
{
///
/// Determines if the endpoint should not be generated because it has the on it
diff --git a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/INamespaceSuffix.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/INamespaceSuffix.cs
similarity index 80%
rename from src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/INamespaceSuffix.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/INamespaceSuffix.cs
index b9bdc3c..c99b572 100644
--- a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/INamespaceSuffix.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/INamespaceSuffix.cs
@@ -1,6 +1,6 @@
using AspNetCore.Server.Attributes;
-namespace AspNetCore.Client.Generator.Framework.AttributeInterfaces
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces
{
///
/// This value is populated by the
diff --git a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IObsolete.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IObsolete.cs
similarity index 80%
rename from src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IObsolete.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IObsolete.cs
index fa98ca9..8166d10 100644
--- a/src/AspNetCore.Client.Generator.Framework/AttributeInterfaces/IObsolete.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/AttributeInterfaces/IObsolete.cs
@@ -1,4 +1,4 @@
-namespace AspNetCore.Client.Generator.Framework.AttributeInterfaces
+namespace Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces
{
///
/// This value is populated by the Obsolete attribute
diff --git a/src/Beffyman.AspNetCore.Client.Generator.Framework/Beffyman.AspNetCore.Client.Generator.Framework.csproj b/src/Beffyman.AspNetCore.Client.Generator.Framework/Beffyman.AspNetCore.Client.Generator.Framework.csproj
new file mode 100644
index 0000000..cb258c0
--- /dev/null
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/Beffyman.AspNetCore.Client.Generator.Framework.csproj
@@ -0,0 +1,16 @@
+
+
+
+ netstandard2.0
+ bin\$(Configuration)\$(TargetFramework)\Beffyman.AspNetCore.Client.Generator.Framework.xml
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/AspNetCore.Client.Generator.Framework/GenerationContext.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/GenerationContext.cs
similarity index 93%
rename from src/AspNetCore.Client.Generator.Framework/GenerationContext.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/GenerationContext.cs
index e2be417..de0b88f 100644
--- a/src/AspNetCore.Client.Generator.Framework/GenerationContext.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/GenerationContext.cs
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
-using AspNetCore.Client.Generator.Framework.SignalR;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
+using Beffyman.AspNetCore.Client.Generator.Framework.SignalR;
-namespace AspNetCore.Client.Generator.Framework
+namespace Beffyman.AspNetCore.Client.Generator.Framework
{
///
/// Context used to keep track of generation details
diff --git a/src/AspNetCore.Client.Generator.Framework/IParameter.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/IParameter.cs
similarity index 87%
rename from src/AspNetCore.Client.Generator.Framework/IParameter.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/IParameter.cs
index bcfb8e5..886d5d1 100644
--- a/src/AspNetCore.Client.Generator.Framework/IParameter.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/IParameter.cs
@@ -1,6 +1,6 @@
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
-namespace AspNetCore.Client.Generator.Framework
+namespace Beffyman.AspNetCore.Client.Generator.Framework
{
///
/// Indicates that the object should be placed as a parameter
diff --git a/src/AspNetCore.Client.Generator.Framework/Navigation/INavNode.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/Navigation/INavNode.cs
similarity index 82%
rename from src/AspNetCore.Client.Generator.Framework/Navigation/INavNode.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/Navigation/INavNode.cs
index 8bddd7a..396ac39 100644
--- a/src/AspNetCore.Client.Generator.Framework/Navigation/INavNode.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/Navigation/INavNode.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace AspNetCore.Client.Generator.Framework.Navigation
+namespace Beffyman.AspNetCore.Client.Generator.Framework.Navigation
{
///
/// A node that can provide its children
diff --git a/src/AspNetCore.Client.Generator.Framework/RequestModifiers/CancellationTokenModifier.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/RequestModifiers/CancellationTokenModifier.cs
similarity index 89%
rename from src/AspNetCore.Client.Generator.Framework/RequestModifiers/CancellationTokenModifier.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/RequestModifiers/CancellationTokenModifier.cs
index a6dc4c1..e2b76f0 100644
--- a/src/AspNetCore.Client.Generator.Framework/RequestModifiers/CancellationTokenModifier.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/RequestModifiers/CancellationTokenModifier.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Threading;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
-namespace AspNetCore.Client.Generator.Framework.RequestModifiers
+namespace Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers
{
///
/// Parameter for the cancellation token for the request
diff --git a/src/Beffyman.AspNetCore.Client.Generator.Framework/RequestModifiers/IRequestModifier.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/RequestModifiers/IRequestModifier.cs
new file mode 100644
index 0000000..14ea211
--- /dev/null
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/RequestModifiers/IRequestModifier.cs
@@ -0,0 +1,12 @@
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+
+namespace Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers
+{
+ ///
+ /// Applies a Flurl modification to the request
+ ///
+ public interface IRequestModifier : INavNode
+ {
+
+ }
+}
diff --git a/src/AspNetCore.Client.Generator.Framework/SignalR/HubController.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubController.cs
similarity index 96%
rename from src/AspNetCore.Client.Generator.Framework/SignalR/HubController.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubController.cs
index c8c60c6..79b8b27 100644
--- a/src/AspNetCore.Client.Generator.Framework/SignalR/HubController.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubController.cs
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using AspNetCore.Client.Generator.Framework.AttributeInterfaces;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
using AspNetCore.Server.Attributes.Http;
-namespace AspNetCore.Client.Generator.Framework.SignalR
+namespace Beffyman.AspNetCore.Client.Generator.Framework.SignalR
{
///
/// Data structure that represents a HubController and all associated properties used for generation
diff --git a/src/AspNetCore.Client.Generator.Framework/SignalR/HubEndpoint.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubEndpoint.cs
similarity index 93%
rename from src/AspNetCore.Client.Generator.Framework/SignalR/HubEndpoint.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubEndpoint.cs
index a0972a6..6eedad8 100644
--- a/src/AspNetCore.Client.Generator.Framework/SignalR/HubEndpoint.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubEndpoint.cs
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
-using AspNetCore.Client.Generator.Framework.AttributeInterfaces;
-using AspNetCore.Client.Generator.Framework.Navigation;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.AttributeInterfaces;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
using AspNetCore.Server.Attributes.Http;
-namespace AspNetCore.Client.Generator.Framework.SignalR
+namespace Beffyman.AspNetCore.Client.Generator.Framework.SignalR
{
///
/// The information about an endpoint used for generation
diff --git a/src/AspNetCore.Client.Generator.Framework/SignalR/HubParameter.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubParameter.cs
similarity index 91%
rename from src/AspNetCore.Client.Generator.Framework/SignalR/HubParameter.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubParameter.cs
index 4fa7f82..bcb8fad 100644
--- a/src/AspNetCore.Client.Generator.Framework/SignalR/HubParameter.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/HubParameter.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
-namespace AspNetCore.Client.Generator.Framework.SignalR
+namespace Beffyman.AspNetCore.Client.Generator.Framework.SignalR
{
///
/// Represents a parameter that can be used inside a Hub Endpoint
diff --git a/src/AspNetCore.Client.Generator.Framework/SignalR/Message.cs b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/Message.cs
similarity index 90%
rename from src/AspNetCore.Client.Generator.Framework/SignalR/Message.cs
rename to src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/Message.cs
index d284b11..66a9f27 100644
--- a/src/AspNetCore.Client.Generator.Framework/SignalR/Message.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator.Framework/SignalR/Message.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace AspNetCore.Client.Generator.Framework.SignalR
+namespace Beffyman.AspNetCore.Client.Generator.Framework.SignalR
{
///
/// Represents a message that can be fired by a HubEndpoint
diff --git a/src/AspNetCore.Client.Generator.Framework/.editorconfig b/src/Beffyman.AspNetCore.Client.Generator/.editorconfig
similarity index 88%
rename from src/AspNetCore.Client.Generator.Framework/.editorconfig
rename to src/Beffyman.AspNetCore.Client.Generator/.editorconfig
index 7d5ba78..89aea01 100644
--- a/src/AspNetCore.Client.Generator.Framework/.editorconfig
+++ b/src/Beffyman.AspNetCore.Client.Generator/.editorconfig
@@ -1,4 +1,4 @@
-# Rules in this file were initially inferred by Visual Studio IntelliCode from the E:\Git_Github\AspNetCore.Client\src\AspNetCore.Client.BlazorJson\ codebase based on best match to current usage at 10/25/2018
+# Rules in this file were initially inferred by Visual Studio IntelliCode from the E:\Git_Github\Beffyman.AspNetCore.Client\src\Beffyman.AspNetCore.Client.BlazorJson\ codebase based on best match to current usage at 10/25/2018
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs]
diff --git a/src/AspNetCore.Client.Generator/AspNetCore.Client.Generator.csproj b/src/Beffyman.AspNetCore.Client.Generator/Beffyman.AspNetCore.Client.Generator.csproj
similarity index 59%
rename from src/AspNetCore.Client.Generator/AspNetCore.Client.Generator.csproj
rename to src/Beffyman.AspNetCore.Client.Generator/Beffyman.AspNetCore.Client.Generator.csproj
index ea8bb86..8ac5986 100644
--- a/src/AspNetCore.Client.Generator/AspNetCore.Client.Generator.csproj
+++ b/src/Beffyman.AspNetCore.Client.Generator/Beffyman.AspNetCore.Client.Generator.csproj
@@ -1,55 +1,37 @@
- netstandard2.0;net462
- PackageReference
- true
- false
- true
- latest
- true
+ netstandard2.1;net472
+ A build task that will generate clients from a asp.net core project
true
true
-
-
- {9A19103F-16F7-4668-BE54-9A1E7A4F7556}
-
-
-
-
- Copyright 2018
- Beffyman
- A build task that will generate clients from a asp.net core project
- git
- https://github.com/Beffyman/AspNetCore.Client
- false
- LICENSE.txt
-
+ true
+ false
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
-
+
-
-
+
+
@@ -81,7 +63,7 @@
- true
+ true
@@ -89,8 +71,4 @@
<_FrameworkAssemblyReferences Remove="@(_FrameworkAssemblyReferences)" />
-
-
-
-
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedBodyParamterDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedBodyParamterDefinition.cs
similarity index 94%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedBodyParamterDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedBodyParamterDefinition.cs
index 8fd5d9d..8fa5973 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedBodyParamterDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedBodyParamterDefinition.cs
@@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
{
public class ExpectedBodyParamterDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedQueryParamterDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedQueryParamterDefinition.cs
similarity index 95%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedQueryParamterDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedQueryParamterDefinition.cs
index ea62cf2..2097ed4 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedQueryParamterDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/ExpectedQueryParamterDefinition.cs
@@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
{
public class ExpectedQueryParamterDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/FunctionsCSharpFile.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/FunctionsCSharpFile.cs
similarity index 89%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/FunctionsCSharpFile.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/FunctionsCSharpFile.cs
index c4f4366..6e1990e 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/FunctionsCSharpFile.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/FunctionsCSharpFile.cs
@@ -1,14 +1,14 @@
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
-using AspNetCore.Client.Generator.Framework;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
-using AspNetCore.Client.Generator.Output;
+using Beffyman.AspNetCore.Client.Generator.Framework;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
+using Beffyman.AspNetCore.Client.Generator.Output;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
{
public class FunctionsCSharpFile
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/HttpTriggerParameter.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/HttpTriggerParameter.cs
similarity index 97%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/HttpTriggerParameter.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/HttpTriggerParameter.cs
index 83db1dd..760b721 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/HttpTriggerParameter.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreFunctions/HttpTriggerParameter.cs
@@ -8,7 +8,7 @@
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions
{
public class HttpTriggerParameter
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ApiVersionDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ApiVersionDefinition.cs
similarity index 84%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ApiVersionDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ApiVersionDefinition.cs
index 2ed21d3..703cf97 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ApiVersionDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ApiVersionDefinition.cs
@@ -4,7 +4,7 @@
using System.Text;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class ApiVersionDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ClassDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ClassDefinition.cs
similarity index 98%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ClassDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ClassDefinition.cs
index fe35d58..8afd11a 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ClassDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ClassDefinition.cs
@@ -9,7 +9,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class ClassDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HTTPType.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HTTPType.cs
similarity index 53%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HTTPType.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HTTPType.cs
index 27fdedb..dc4820a 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HTTPType.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HTTPType.cs
@@ -1,4 +1,4 @@
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public enum HttpAttributeType
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HeaderDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HeaderDefinition.cs
similarity index 92%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HeaderDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HeaderDefinition.cs
index 60efec4..8942f5e 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HeaderDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HeaderDefinition.cs
@@ -2,7 +2,7 @@
using AspNetCore.Server.Attributes.Http;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class HeaderDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HttpControllerCSharpFile.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HttpControllerCSharpFile.cs
similarity index 92%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HttpControllerCSharpFile.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HttpControllerCSharpFile.cs
index 5e93d6a..09c6fed 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HttpControllerCSharpFile.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/HttpControllerCSharpFile.cs
@@ -1,13 +1,13 @@
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
-using AspNetCore.Client.Generator.Framework;
-using AspNetCore.Client.Generator.Output;
+using Beffyman.AspNetCore.Client.Generator.Framework;
+using Beffyman.AspNetCore.Client.Generator.Output;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class HttpControllerCSharpFile
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/MethodDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/MethodDefinition.cs
similarity index 97%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/MethodDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/MethodDefinition.cs
index ffe94c5..effda5f 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/MethodDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/MethodDefinition.cs
@@ -2,13 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
using AspNetCore.Server.Attributes.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class MethodDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterDefinition.cs
similarity index 93%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterDefinition.cs
index b4352bb..5fb850c 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterDefinition.cs
@@ -1,17 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class ParameterDefinition
{
public string Name { get; }
public string Type { get; }
public string Default { get; }
+ public bool Invalid { get; }
public ParameterAttributeOptions Options { get; }
@@ -22,6 +23,13 @@ public ParameterDefinition(ParameterSyntax parameter, HttpRoute fullRoute)
Type = parameter.Type.ToFullString().Trim();
Default = parameter.Default?.Value.ToFullString().Trim();
+ if (Helpers.IsInvalidParameterType(Type))
+ {
+ Invalid = true;
+ return;
+ }
+
+
var attributes = parameter.AttributeLists.SelectMany(x => x.Attributes).ToList();
Options = new ParameterAttributeOptions
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterHeaderDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterHeaderDefinition.cs
similarity index 96%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterHeaderDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterHeaderDefinition.cs
index e455b21..ad791a6 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterHeaderDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ParameterHeaderDefinition.cs
@@ -3,7 +3,7 @@
using AspNetCore.Server.Attributes.Http;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class ParameterHeaderDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ResponseTypeDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ResponseTypeDefinition.cs
similarity index 96%
rename from src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ResponseTypeDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ResponseTypeDefinition.cs
index 3e45595..b6490d2 100644
--- a/src/AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ResponseTypeDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/AspNetCoreHttp/ResponseTypeDefinition.cs
@@ -2,7 +2,7 @@
using System.Net;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp
{
public class ResponseTypeDefinition
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/SignalR/HubCSharpFile.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/HubCSharpFile.cs
similarity index 92%
rename from src/AspNetCore.Client.Generator/CSharp/SignalR/HubCSharpFile.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/HubCSharpFile.cs
index 216c8bd..59a2a12 100644
--- a/src/AspNetCore.Client.Generator/CSharp/SignalR/HubCSharpFile.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/HubCSharpFile.cs
@@ -1,13 +1,13 @@
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
-using AspNetCore.Client.Generator.Framework;
-using AspNetCore.Client.Generator.Output;
+using Beffyman.AspNetCore.Client.Generator.Framework;
+using Beffyman.AspNetCore.Client.Generator.Output;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.SignalR
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.SignalR
{
public class HubCSharpFile
{
diff --git a/src/AspNetCore.Client.Generator/CSharp/SignalR/HubParameterDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/HubParameterDefinition.cs
similarity index 77%
rename from src/AspNetCore.Client.Generator/CSharp/SignalR/HubParameterDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/HubParameterDefinition.cs
index e9b976f..d992360 100644
--- a/src/AspNetCore.Client.Generator/CSharp/SignalR/HubParameterDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/HubParameterDefinition.cs
@@ -1,12 +1,13 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.CSharp.SignalR
+namespace Beffyman.AspNetCore.Client.Generator.CSharp.SignalR
{
public class HubParameterDefinition
{
public string Name { get; }
public string Type { get; }
public string Default { get; }
+ public bool Invalid { get; }
public HubParameterDefinition(ParameterSyntax parameter)
@@ -14,6 +15,11 @@ public HubParameterDefinition(ParameterSyntax parameter)
Name = parameter.Identifier.ValueText.Trim();
Type = parameter.Type.ToFullString().Trim();
Default = parameter.Default?.Value.ToFullString().Trim();
+
+ if (Helpers.IsInvalidParameterType(Type))
+ {
+ Invalid = true;
+ }
}
public override string ToString()
diff --git a/src/AspNetCore.Client.Generator/CSharp/SignalR/MessageDefinition.cs b/src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/MessageDefinition.cs
similarity index 94%
rename from src/AspNetCore.Client.Generator/CSharp/SignalR/MessageDefinition.cs
rename to src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/MessageDefinition.cs
index 949eb8f..d7027a9 100644
--- a/src/AspNetCore.Client.Generator/CSharp/SignalR/MessageDefinition.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/CSharp/SignalR/MessageDefinition.cs
@@ -2,7 +2,7 @@
using System.Linq;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace AspNetCore.Client.Generator.SignalR
+namespace Beffyman.AspNetCore.Client.Generator.SignalR
{
public class MessageDefinition
{
diff --git a/src/AspNetCore.Client.Generator/Constants.cs b/src/Beffyman.AspNetCore.Client.Generator/Constants.cs
similarity index 85%
rename from src/AspNetCore.Client.Generator/Constants.cs
rename to src/Beffyman.AspNetCore.Client.Generator/Constants.cs
index 3df6a9b..dc9e7f6 100644
--- a/src/AspNetCore.Client.Generator/Constants.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/Constants.cs
@@ -1,8 +1,8 @@
-using AspNetCore.Client.Http;
-using AspNetCore.Client.RequestModifiers;
-using AspNetCore.Client.Serializers;
+using Beffyman.AspNetCore.Client.Http;
+using Beffyman.AspNetCore.Client.RequestModifiers;
+using Beffyman.AspNetCore.Client.Serializers;
-namespace AspNetCore.Client.Generator
+namespace Beffyman.AspNetCore.Client.Generator
{
public static class Constants
{
@@ -25,7 +25,7 @@ public static class Constants
public const string RequestModifier = nameof(IHttpRequestModifier);
public const string RequestModifierField = "Modifier";
-
+ public const string ApiVersionAttribute = "ApiVersionAttribute";
public const string IActionResult = "IActionResult";
public const string ControllerRouteReserved = "controller";
diff --git a/src/AspNetCore.Client.Generator/ContextIsolatedTask.cs b/src/Beffyman.AspNetCore.Client.Generator/ContextIsolatedTask.cs
similarity index 98%
rename from src/AspNetCore.Client.Generator/ContextIsolatedTask.cs
rename to src/Beffyman.AspNetCore.Client.Generator/ContextIsolatedTask.cs
index 6dac208..74e77ad 100644
--- a/src/AspNetCore.Client.Generator/ContextIsolatedTask.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/ContextIsolatedTask.cs
@@ -1,5 +1,4 @@
-
-#if NETSTANDARD2_0
+#if NETSTANDARD2_1
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System;
@@ -11,7 +10,7 @@
using System.Threading;
using System.Runtime.Loader;
-namespace AspNetCore.Client.Generator
+namespace Beffyman.AspNetCore.Client.Generator
{
///
/// https://github.com/AArnott/Nerdbank.MSBuildExtension
@@ -194,5 +193,4 @@ protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
}
}
-
-#endif
+#endif
\ No newline at end of file
diff --git a/src/AspNetCore.Client.Generator/GeneratorTask.cs b/src/Beffyman.AspNetCore.Client.Generator/GeneratorTask.cs
similarity index 92%
rename from src/AspNetCore.Client.Generator/GeneratorTask.cs
rename to src/Beffyman.AspNetCore.Client.Generator/GeneratorTask.cs
index df21994..76375db 100644
--- a/src/AspNetCore.Client.Generator/GeneratorTask.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/GeneratorTask.cs
@@ -2,22 +2,21 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions;
-using AspNetCore.Client.Generator.CSharp.AspNetCoreHttp;
-using AspNetCore.Client.Generator.CSharp.SignalR;
-using AspNetCore.Client.Generator.Framework;
-using AspNetCore.Client.Generator.Json;
-using AspNetCore.Client.Generator.Output;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
-
-namespace AspNetCore.Client.Generator
+using Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions;
+using Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp;
+using Beffyman.AspNetCore.Client.Generator.CSharp.SignalR;
+using Beffyman.AspNetCore.Client.Generator.Framework;
+using Beffyman.AspNetCore.Client.Generator.Json;
+using Beffyman.AspNetCore.Client.Generator.Output;
+
+namespace Beffyman.AspNetCore.Client.Generator
{
public class GeneratorTask :
-#if NET462
+#if NET472
Microsoft.Build.Utilities.Task
#endif
-#if NETSTANDARD2_0
+#if NETSTANDARD2_1
ContextIsolatedTask
#endif
{
@@ -57,31 +56,28 @@ public void Fill(IDictionary properties)
public bool ByPassExecute()
{
-#if NET462
+#if NET472
return Execute();
#endif
-#if NETSTANDARD2_0
+#if NETSTANDARD2_1
return ExecuteIsolated();
#endif
-
}
-#if NET462
+#if NET472
public override bool Execute()
#endif
-#if NETSTANDARD2_0
+#if NETSTANDARD2_1
protected override bool ExecuteIsolated()
#endif
-
{
Log.LogCommandLine($">> [{typeof(GeneratorTask).Namespace}] START");
#if !DEBUG
try
{
-
#endif
#region Settings Map
diff --git a/src/AspNetCore.Client.Generator/Helpers.cs b/src/Beffyman.AspNetCore.Client.Generator/Helpers.cs
similarity index 87%
rename from src/AspNetCore.Client.Generator/Helpers.cs
rename to src/Beffyman.AspNetCore.Client.Generator/Helpers.cs
index 987a216..0edc716 100644
--- a/src/AspNetCore.Client.Generator/Helpers.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/Helpers.cs
@@ -8,17 +8,17 @@
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
-using AspNetCore.Client.Generator.CSharp.AspNetCoreHttp;
-using AspNetCore.Client.Generator.Framework;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
-using AspNetCore.Client.Generator.Framework.Navigation;
+using Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp;
+using Beffyman.AspNetCore.Client.Generator.Framework;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
+using Beffyman.AspNetCore.Client.Generator.Framework.Navigation;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing.Template;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Newtonsoft.Json;
+using System.Text.Json;
-namespace AspNetCore.Client.Generator
+namespace Beffyman.AspNetCore.Client.Generator
{
internal static class Helpers
{
@@ -169,26 +169,25 @@ public static void SafelyWriteToFile(string path, string text)
- private static readonly JsonSerializerSettings SETTINGS = new JsonSerializerSettings
+ private static readonly JsonSerializerOptions SETTINGS = new JsonSerializerOptions
{
- Formatting = Formatting.Indented,
- NullValueHandling = NullValueHandling.Include,
- MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
+ PropertyNameCaseInsensitive = true,
+ WriteIndented = true
};
public static string SerializeToJson(this object obj)
{
- return JsonConvert.SerializeObject(obj, SETTINGS);
+ return JsonSerializer.Serialize(obj, SETTINGS);
}
public static T DeserializeFromJson(this string str)
{
- return JsonConvert.DeserializeObject(str, SETTINGS);
+ return JsonSerializer.Deserialize(str, SETTINGS);
}
public static object DeserializeFromJson(this string str, Type t)
{
- return JsonConvert.DeserializeObject(str, t, SETTINGS);
+ return JsonSerializer.Deserialize(str, t, SETTINGS);
}
@@ -264,24 +263,28 @@ public static string GetEnumerableType(string type)
}
}
-
- public static string[] KnownPrimitives = new string[]
+ public static HashSet KnownExcludedParameters = new HashSet(StringComparer.CurrentCultureIgnoreCase)
{
- "char",typeof(char).Name,
- "byte",typeof(byte).Name,
- "sbyte",typeof(sbyte).Name,
- "ushort",typeof(ushort).Name,
- "int",typeof(int).Name,
- "uint",typeof(uint).Name,
- "long",typeof(long).Name,
- "ulong",typeof(ulong).Name,
- "float",typeof(float).Name,
- "double",typeof(double).Name,
- "string",typeof(string).Name,
- "bool",typeof(bool).Name,
- "DateTime",typeof(DateTime).Name,
- "DateTimeOffset",typeof(DateTimeOffset).Name,
- "Guid",typeof(Guid).Name,
+ nameof(CancellationToken)
+ };
+
+ public static HashSet KnownPrimitives = new HashSet(StringComparer.CurrentCultureIgnoreCase)
+ {
+ "char",typeof(char).Name,
+ "byte",typeof(byte).Name,
+ "sbyte",typeof(sbyte).Name,
+ "ushort",typeof(ushort).Name,
+ "int",typeof(int).Name,
+ "uint",typeof(uint).Name,
+ "long",typeof(long).Name,
+ "ulong",typeof(ulong).Name,
+ "float",typeof(float).Name,
+ "double",typeof(double).Name,
+ "string",typeof(string).Name,
+ "bool",typeof(bool).Name,
+ "DateTime",typeof(DateTime).Name,
+ "DateTimeOffset",typeof(DateTimeOffset).Name,
+ "Guid",typeof(Guid).Name,
};
private static Regex NULLABLE_MATCHER = new Regex(@"((.+)\?)|(Nullable<(.+)>)");
@@ -306,7 +309,14 @@ public static bool IsRoutableType(string type)
{
type = ConvertFromNullable(type, out _);
- return KnownPrimitives.Contains(type, StringComparer.CurrentCultureIgnoreCase);
+ return KnownPrimitives.Contains(type);
+ }
+
+ public static bool IsInvalidParameterType(string type)
+ {
+ type = ConvertFromNullable(type, out _);
+
+ return KnownExcludedParameters.Contains(type);
}
public static bool IsRouteParameter(string name, HttpRoute fullRouteTemplate)
@@ -585,6 +595,12 @@ public static string GetAttributeValue(this AttributeSyntax attr)
{
return source.SingleOrDefault(x => x.Name.ToFullString().MatchesAttribute(typeof(T).Name));
}
+
+ public static AttributeSyntax GetAttribute(this IEnumerable source, string attributeName)
+ {
+ return source.SingleOrDefault(x => x.Name.ToFullString().MatchesAttribute(attributeName));
+ }
+
public static IEnumerable GetAttributes(this IEnumerable source) where T : Attribute
{
return source.Where(x => x.Name.ToFullString().MatchesAttribute(typeof(T).Name));
diff --git a/src/Beffyman.AspNetCore.Client.Generator/Json/HostJsonFile.cs b/src/Beffyman.AspNetCore.Client.Generator/Json/HostJsonFile.cs
new file mode 100644
index 0000000..d20b609
--- /dev/null
+++ b/src/Beffyman.AspNetCore.Client.Generator/Json/HostJsonFile.cs
@@ -0,0 +1,16 @@
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
+
+namespace Beffyman.AspNetCore.Client.Generator.Json
+{
+ public class HostJsonFile
+ {
+ public HostJson Data { get; }
+
+ public HostJsonFile(string filePath)
+ {
+ var fileText = Helpers.SafelyReadFromFile(filePath);
+
+ Data = Helpers.DeserializeFromJson(fileText);
+ }
+ }
+}
diff --git a/src/AspNetCore.Client.Generator/Output/ClassParser.cs b/src/Beffyman.AspNetCore.Client.Generator/Output/ClassParser.cs
similarity index 92%
rename from src/AspNetCore.Client.Generator/Output/ClassParser.cs
rename to src/Beffyman.AspNetCore.Client.Generator/Output/ClassParser.cs
index b866841..b6903cb 100644
--- a/src/AspNetCore.Client.Generator/Output/ClassParser.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/Output/ClassParser.cs
@@ -1,824 +1,824 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Text.RegularExpressions;
-using System.Threading.Channels;
-using System.Threading.Tasks;
-using AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions;
-using AspNetCore.Client.Generator.CSharp.AspNetCoreHttp;
-using AspNetCore.Client.Generator.CSharp.SignalR;
-using AspNetCore.Client.Generator.Framework;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
-using AspNetCore.Client.Generator.Framework.SignalR;
-using AspNetCore.Client.Generator.SignalR;
-using AspNetCore.Server.Attributes;
-using AspNetCore.Server.Attributes.Functions;
-using AspNetCore.Server.Attributes.Http;
-using AspNetCore.Server.Attributes.SignalR;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Azure.WebJobs;
-using Microsoft.Azure.WebJobs.Extensions.Http;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace AspNetCore.Client.Generator.Output
-{
- public static class ClassParser
- {
- private static readonly Regex RouteVersionRegex = new Regex(@"\/([v|V]\d+)\/");
-
- #region Http
-
- public static AspNetCoreHttpController ReadClassAsHttpController(ClassDeclarationSyntax syntax)
- {
- var attributes = syntax.AttributeLists.SelectMany(x => x.Attributes).ToList();
-
-
- var controller = new AspNetCoreHttpController();
- try
- {
- controller.Name = $@"{syntax.Identifier.ValueText.Trim().Replace("Controller", "")}";
-
- controller.Abstract = syntax.Modifiers.Any(x => x.Text == "abstract");
-
- if (syntax.BaseList == null)
- {
- controller.Ignored = true;
- return controller;
- }
-
- controller.BaseClass = syntax.BaseList.Types.Where(x => x.ToFullString().Trim().EndsWith("Controller")).SingleOrDefault()?.ToFullString().Trim().Replace("Controller", "");
-
- controller.Ignored = attributes.HasAttribute();
-
-
- var namespaceAttribute = attributes.GetAttribute();
- if (namespaceAttribute != null)
- {
- controller.NamespaceSuffix = namespaceAttribute.GetAttributeValue();
- }
-
- var routeAttribute = attributes.GetAttribute();
- if (routeAttribute != null)//Fetch route from RouteAttribute
- {
- controller.Route = new HttpRoute(routeAttribute.GetAttributeValue());
- }
-
- if (controller.Route == null && !controller.Abstract && !controller.Ignored)//No Route, invalid controller
- {
- controller.Ignored = true;
- throw new NotSupportedException("Controller must have a route to be valid for generation.");
- }
-
- if (controller.Route != null)
- {
- var match = RouteVersionRegex.Match(controller.Route.Value);
- if (match.Success)
- {
- var group = match.Groups[1];
- controller.NamespaceVersion = group.Value.ToUpper();
- }
- }
- else
- {
- controller.Route = new HttpRoute(string.Empty);
- }
-
- var versionAttribute = attributes.GetAttribute();
- if (versionAttribute != null)
- {
- var version = new ApiVersionDefinition(versionAttribute);
-
- controller.NamespaceVersion = $"V{version.Version.Replace(".", "_")}";
-
- var versionConstraint = controller.Route.Constraints.OfType().SingleOrDefault();
- if (versionConstraint != null)
- {
- controller.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, false);
- }
- else
- {
- controller.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, true);
- }
- }
-
- //Response types
- var responseTypes = attributes.GetAttributes();
- var responses = responseTypes.Select(x => new ResponseTypeDefinition(x)).ToList();
- controller.ResponseTypes = responses.Select(x => new ResponseType(x.Type, Helpers.EnumParse(x.StatusValue))).ToList();
-
-
-
- var parameterHeaders = attributes.GetAttributes()
- .Select(x => new ParameterHeaderDefinition(x))
- .ToList();
- controller.ParameterHeader = parameterHeaders.Select(x => new ParameterHeader(x.Name, x.Type, x.DefaultValue)).ToList();
-
-
-
- var headers = attributes.GetAttributes()
- .Select(x => new HeaderDefinition(x))
- .ToList();
- controller.ConstantHeader = headers.Select(x => new ConstantHeader(x.Name, x.Value)).ToList();
-
- //Authorize Attribute
- controller.IsSecured = attributes.HasAttribute();
-
- //Obsolete Attribute
- var obsoleteAttribute = attributes.GetAttribute();
- if (obsoleteAttribute != null)
- {
- controller.Obsolete = true;
- controller.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
- }
-
- //Only public endpoints can be hit anyways
- var methods = syntax.DescendantNodes().OfType()
- .Where(x => x.Modifiers.Any(y => y.Text == "public"))
- .ToList();
- controller.Endpoints = methods.Select(x => ReadMethodAsHttpEndpoint(controller, x)).ToList();
-
- if (!controller.Endpoints.Any(x => !x.Ignored)
- && controller.Endpoints.Count > 0
- && !controller.Abstract)
- {
- controller.Ignored = true;
- }
- }
- catch (NotSupportedException nse)
- {
- if (controller.Ignored)
- {
- return controller;
- }
-
- controller.Failed = true;
- controller.Error = nse.Message;
- }
-#if !DEBUG
- catch (Exception ex)
- {
- controller.Failed = true;
- controller.UnexpectedFailure = true;
- controller.Error = ex.ToString();
- }
-#endif
- return controller;
- }
-
-
- private static AspNetCoreHttpEndpoint ReadMethodAsHttpEndpoint(AspNetCoreHttpController parent, MethodDeclarationSyntax syntax)
- {
- var attributes = syntax.DescendantNodes().OfType().SelectMany(x => x.Attributes).ToList();
-
- var endpoint = new AspNetCoreHttpEndpoint(parent);
-
- endpoint.Name = syntax.Identifier.ValueText.Trim();
- endpoint.FormattedName = syntax.Identifier.ValueText.CleanMethodName();
-
-
- endpoint.Virtual = syntax.Modifiers.Any(x => x.Text == "virtual");
- endpoint.Override = syntax.Modifiers.Any(x => x.Text == "override");
- endpoint.New = syntax.Modifiers.Any(x => x.Text == "new");
-
-
- //Ignore generator attribute
- endpoint.Ignored = attributes.HasAttribute();
-
-
- //Route Attribute
-
- var routeAttribute = attributes.GetAttribute();
- if (routeAttribute != null)//Fetch route from RouteAttribute
- {
- endpoint.Route = new HttpRoute(routeAttribute.GetAttributeValue());
- }
-
-
- //HTTP Attribute
- var knownHttpAttributes = new List
- {
- $"{Constants.Http}{HttpAttributeType.Delete}",
- $"{Constants.Http}{HttpAttributeType.Get}",
- $"{Constants.Http}{HttpAttributeType.Patch}",
- $"{Constants.Http}{HttpAttributeType.Post}",
- $"{Constants.Http}{HttpAttributeType.Put}",
- };
-
- var httpAttribute = attributes.SingleOrDefault(x => knownHttpAttributes.Any(y => x.Name.ToFullString().MatchesAttribute(y)));
- if (httpAttribute == null)
- {
- endpoint.Ignored = true;
- }
- else
- {
- var httpType = (HttpAttributeType)Enum.Parse(typeof(HttpAttributeType),
- httpAttribute.Name
- .ToFullString()
- .Replace(Constants.Http, "")
- .Replace(Constants.Attribute, ""));
-
- endpoint.HttpType = Helpers.HttpMethodFromEnum(httpType);
- }
-
-
-
- if (endpoint.Route == null && httpAttribute?.ArgumentList != null)//If Route was never fetched from RouteAttribute or if they used the Http(template) override
- {
- endpoint.Route = new HttpRoute(httpAttribute.GetAttributeValue());
- }
-
- //Ignore method if it doesn't have a route or http attribute
- if (endpoint.Route == null && httpAttribute == null)
- {
- endpoint.Ignored = true;
- return endpoint;
- }
-
- if (endpoint.Route == null)
- {
- endpoint.Route = new HttpRoute(string.Empty);
- }
-
- var versionAttribute = attributes.GetAttribute();
- if (versionAttribute != null)
- {
- var version = new ApiVersionDefinition(versionAttribute);
-
- var versionConstraint = endpoint.Route.Constraints.OfType().SingleOrDefault();
- if (versionConstraint != null)
- {
- endpoint.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, false);
- }
- else
- {
- endpoint.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, true);
- }
- }
-
-
- if (endpoint.Route.Version != null && parent.Route.Version != null)
- {
- throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has {nameof(ApiVersionAttribute)} on both it's method and class");
- }
-
- //Obsolete Attribute
- var obsoleteAttribute = attributes.GetAttribute();
- if (obsoleteAttribute != null)
- {
- endpoint.Obsolete = true;
- endpoint.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
- }
-
- //Authorize Attribute
- endpoint.IsSecured = attributes.HasAttribute();
-
-
- //Response types
- var responseTypes = attributes.GetAttributes();
- var responses = responseTypes.Select(x => new ResponseTypeDefinition(x)).ToList();
- responses.Add(new ResponseTypeDefinition(true));
-
- endpoint.ResponseTypes = responses.Select(x => new ResponseType(x.Type, Helpers.EnumParse(x.StatusValue))).ToList();
-
- var duplicateResponseTypes = endpoint.GetResponseTypes().GroupBy(x => x.Status).Where(x => x.Count() > 1).ToList();
-
- if (duplicateResponseTypes.Any())
- {
- throw new NotSupportedException($"Endpoint has multiple response types of the same status defined. {string.Join(", ", duplicateResponseTypes.Select(x => x.Key?.ToString()))}");
- }
- //Add after so we don't get duplicate error from the null Status
- endpoint.ResponseTypes.Add(new ExceptionResponseType());
-
-
-
-
- var parameters = syntax.ParameterList.Parameters.Select(x => new ParameterDefinition(x, endpoint.GetFullRoute(parent))).ToList();
-
-
- var routeParams = parameters.Where(x => x.Options.FromRoute).Select(x => new RouteParameter(x.RouteName, x.Type, x.Default)).ToList();
- var queryParams = parameters.Where(x => x.Options.FromQuery).Select(x => new QueryParameter(x.Options.QueryName, x.Type, x.Default, x.Options.QueryObject)).ToList();
- var bodyParam = parameters.Where(x => x.Options.FromBody).Select(x => new BodyParameter(x.Name, x.Type, x.Default)).SingleOrDefault();
-
-
- endpoint.Parameters = routeParams.Cast().Union(queryParams).Union(new List { bodyParam }).NotNull().ToList();
-
- endpoint.Parameters.Add(new CancellationTokenModifier());
- endpoint.Parameters.Add(new CookieModifier());
- endpoint.Parameters.Add(new HeadersModifier());
- endpoint.Parameters.Add(new TimeoutModifier());
- if (endpoint.IsSecured)
- {
- endpoint.Parameters.Add(new SecurityModifier());
- }
-
-
- var parameterHeaders = attributes.GetAttributes()
- .Select(x => new ParameterHeaderDefinition(x))
- .ToList();
- endpoint.ParameterHeader = parameterHeaders.Select(x => new ParameterHeader(x.Name, x.Type, x.DefaultValue)).ToList();
-
-
-
- var headers = attributes.GetAttributes()
- .Select(x => new HeaderDefinition(x))
- .ToList();
- endpoint.ConstantHeader = headers.Select(x => new ConstantHeader(x.Name, x.Value)).ToList();
-
-
- var rawReturnType = syntax.ReturnType?.ToFullString();
-
- var returnType = Helpers.GetTypeFromString(rawReturnType.Trim());
-
- while (returnType.IsContainerReturnType())
- {
- returnType = returnType.Arguments.SingleOrDefault();
- }
-
- if (Helpers.IsType(typeof(IActionResult).FullName, returnType?.Name))
- {
- returnType = null;
- }
-
- if (returnType?.Name == "void"
- || (Helpers.IsType(typeof(Task).FullName, returnType?.Name) && (!returnType?.Arguments.Any() ?? false)))
- {
- returnType = null;
- }
-
- if (returnType.IsFileReturnType())
- {
- returnType = new Helpers.TypeString(typeof(Stream).FullName);
- endpoint.ReturnsStream = true;
- }
-
- rawReturnType = returnType?.ToString();
-
- endpoint.ReturnType = rawReturnType?.Trim();
-
- var okStatus = endpoint.ResponseTypes.SingleOrDefault(x => x.Status == HttpStatusCode.OK);
-
- if (okStatus != null
- && endpoint.ReturnType != null
- && Helpers.IsType(okStatus.ActionType, endpoint.ReturnType))
- {
- //Remove the OkStatus since it is the same as the method return
- endpoint.ResponseTypes.Remove(okStatus);
- }
- else if (okStatus != null
- && endpoint.ReturnType != null
- && !Helpers.IsType(okStatus.ActionType, endpoint.ReturnType))
- {
- throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has a OK response type of {okStatus.ActionType}, but the method return {endpoint.ReturnType}");
- }
-
- var duplicateParameters = endpoint.GetParametersWithoutResponseTypes().GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
-
- if (duplicateParameters.Any())
- {
- throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
- }
-
- var invalidParameters = endpoint.GetParameters().Where(x => !Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsValidIdentifier(x.Name)).ToList();
-
- if (invalidParameters.Any())
- {
- throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has parameters that are invalid variable names. {string.Join(", ", invalidParameters.Select(x => x.Name))}");
- }
-
- var fullRoute = endpoint.GetFullRoute(parent);
- if (fullRoute?.Version?.Query ?? false)
- {
- endpoint.Parameters.Add(new QueryParameter($"api-version={fullRoute?.Version}"));
- }
-
-
- return endpoint;
- }
-
- #endregion Http
-
-
- #region SignalR
-
- public static HubController ReadClassAsHubController(ClassDeclarationSyntax syntax)
- {
- var attributes = syntax.AttributeLists.SelectMany(x => x.Attributes).ToList();
-
- var controller = new HubController();
- try
- {
- controller.Name = $@"{syntax.Identifier.ValueText.Trim().Replace("Hub", "")}";
-
- controller.Abstract = syntax.Modifiers.Any(x => x.Text == "abstract");
-
- if (syntax.BaseList == null)
- {
- controller.Ignored = true;
- return controller;
- }
-
- var generatedAttribute = attributes.GetAttribute();
- if (generatedAttribute == null)
- {
- controller.Ignored = true;
- return controller;
- }
-
- controller.BaseClass = syntax.BaseList.Types.Where(x => x.ToFullString().Trim().EndsWith("Hub")).SingleOrDefault()?.ToFullString().Trim().Replace("Hub", "");
-
- controller.Ignored = attributes.HasAttribute();
-
-
- var namespaceAttribute = attributes.GetAttribute();
- if (namespaceAttribute != null)
- {
- controller.NamespaceSuffix = namespaceAttribute.ArgumentList.Arguments.ToFullString().Replace("\"", "");
- }
-
- var routeAttribute = attributes.GetAttribute();
- if (routeAttribute != null)//Fetch route from RouteAttribute
- {
- controller.Route = routeAttribute.ArgumentList.Arguments.ToFullString().Replace("\"", "");
- }
-
- if (controller.Route == null && !controller.Abstract && !controller.Ignored)//No Route, invalid controller
- {
- controller.Ignored = true;
- throw new NotSupportedException("Controller must have a route to be valid for generation.");
- }
-
- if (controller.Route != null)
- {
- var match = RouteVersionRegex.Match(controller.Route);
- if (match.Success)
- {
- var group = match.Groups[1];
- controller.NamespaceVersion = group.Value.ToUpper();
- }
- }
-
- //Obsolete Attribute
- var obsoleteAttribute = attributes.GetAttribute();
- if (obsoleteAttribute != null)
- {
- controller.Obsolete = true;
- controller.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
- }
-
- //Only public endpoints can be hit anyways
- var methods = syntax.DescendantNodes().OfType()
- .Where(x => x.Modifiers.Any(y => y.Text == "public"))
- .ToList();
- controller.Endpoints = methods.Select(x => ReadMethodAsHubEndpoint(controller, x)).ToList();
-
- if (!controller.Endpoints.Any(x => !x.Ignored))
- {
- controller.Ignored = true;
- }
- }
- catch (NotSupportedException nse)
- {
- if (controller.Ignored)
- {
- return controller;
- }
-
- controller.Failed = true;
- controller.Error = nse.Message;
- }
-#if !DEBUG
- catch (Exception ex)
- {
- controller.Failed = true;
- controller.UnexpectedFailure = true;
- controller.Error = ex.ToString();
- }
-#endif
- return controller;
- }
-
-
-
- private static HubEndpoint ReadMethodAsHubEndpoint(HubController parent, MethodDeclarationSyntax syntax)
- {
- var attributes = syntax.DescendantNodes().OfType().SelectMany(x => x.Attributes).ToList();
-
- var endpoint = new HubEndpoint(parent);
-
- endpoint.Name = syntax.Identifier.ValueText.CleanMethodName();
-
-
- endpoint.Virtual = syntax.Modifiers.Any(x => x.Text == "virtual");
- endpoint.Override = syntax.Modifiers.Any(x => x.Text == "override");
- endpoint.New = syntax.Modifiers.Any(x => x.Text == "new");
-
-
- //Ignore generator attribute
- endpoint.Ignored = attributes.HasAttribute();
-
- //Obsolete Attribute
- var obsoleteAttribute = attributes.GetAttribute();
- if (obsoleteAttribute != null)
- {
- endpoint.Obsolete = true;
- endpoint.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
- }
-
- //Response types
- var messageAttributes = attributes.GetAttributes();
- var messages = messageAttributes.Select(x => new MessageDefinition(x)).ToList();
-
- endpoint.Messages = messages.Select(x => new Message(x.Name, x.Types)).ToList();
-
- var duplicateMessages = endpoint.Messages.GroupBy(x => x.Name).Where(x => x.Count() > 1 && !x.All(y => y.Types.SequenceEqual(x.First().Types))).ToList();
-
- if (duplicateMessages.Any())
- {
- throw new NotSupportedException($"Hub has the same message with different parameters defined on different endpoints. {string.Join(", ", duplicateMessages.Select(x => x.Key?.ToString()))}");
- }
-
-
-
-
- var parameters = syntax.ParameterList.Parameters.Select(x => new HubParameterDefinition(x)).ToList();
- var hubParams = parameters.Select(x => new HubParameter(x.Name, x.Type, x.Default)).ToList();
-
- endpoint.Parameters = hubParams.Cast().NotNull().ToList();
-
- var duplicateParameters = endpoint.GetParameters().GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
-
- if (duplicateParameters.Any())
- {
- throw new NotSupportedException($"Endpoint has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
- }
-
- var invalidParameters = endpoint.GetParameters().Where(x => !Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsValidIdentifier(x.Name)).ToList();
-
- if (invalidParameters.Any())
- {
- throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.Name} has parameters that are invalid variable names. {string.Join(", ", invalidParameters.Select(x => x.Name))}");
- }
-
-
- var rawReturnType = syntax.ReturnType?.ToFullString();
-
- var returnType = Helpers.GetTypeFromString(rawReturnType.Trim());
-
- while (returnType.IsContainerReturnType())
- {
- returnType = returnType.Arguments.SingleOrDefault();
- }
-
- if (Helpers.IsType(typeof(ChannelReader<>).FullName.CleanGenericTypeDefinition(), returnType?.Name))
- {
- endpoint.Channel = true;
- endpoint.ChannelType = returnType.Arguments.SingleOrDefault().ToString();
- }
-
-
- return endpoint;
- }
-
-
-
-
- #endregion SignalR
-
-
- #region Functions
-
- public static FunctionEndpoint ReadMethodAsFunction(MethodDeclarationSyntax syntax, HostJson hostData)
- {
- var attributes = syntax.DescendantNodes().OfType().SelectMany(x => x.Attributes).ToList();
-
- var endpoint = new FunctionEndpoint();
- try
- {
- var endpointName = attributes.GetAttribute();
-
- if (endpointName == null)
- {
- endpoint.Ignored = true;
- return endpoint;
- }
-
- endpoint.Name = endpointName.GetAttributeValue();
-
- //Ignore generator attribute
- endpoint.Ignored = attributes.HasAttribute();
-
-
- //Obsolete Attribute
- var obsoleteAttribute = attributes.GetAttribute();
- if (obsoleteAttribute != null)
- {
- endpoint.Obsolete = true;
- endpoint.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
- }
-
- //Response types
- var responseTypes = attributes.GetAttributes();
- var responses = responseTypes.Select(x => new ResponseTypeDefinition(x)).ToList();
- responses.Add(new ResponseTypeDefinition(true));
-
- endpoint.ResponseTypes = responses.Select(x => new ResponseType(x.Type, Helpers.EnumParse(x.StatusValue))).ToList();
-
- var duplicateResponseTypes = endpoint.GetResponseTypes().GroupBy(x => x.Status).Where(x => x.Count() > 1).ToList();
-
- if (duplicateResponseTypes.Any())
- {
- throw new NotSupportedException($"Endpoint has multiple response types of the same status defined. {string.Join(", ", duplicateResponseTypes.Select(x => x.Key?.ToString()))}");
- }
- //Add after so we don't get duplicate error from the null Status
- endpoint.ResponseTypes.Add(new ExceptionResponseType());
-
-
- //Need to check if the function has a HttpTrigger
- var httpTriggerAttribute = syntax.ParameterList.Parameters.SingleOrDefault(x => x.AttributeLists.SelectMany(y => y.Attributes).HasAttribute());
-
- if (httpTriggerAttribute == null)
- {
- endpoint.Ignored = true;
- return endpoint;
- }
-
- var triggerAttribute = new HttpTriggerParameter(httpTriggerAttribute);
-
- endpoint.SupportedMethods = triggerAttribute.Methods;
-
- var routePrefix = hostData?.http?.routePrefix ?? "api";
-
- if (triggerAttribute.Route != null)
- {
- var route = triggerAttribute.Route.TrimStart('/');
-
- if (!string.IsNullOrEmpty(routePrefix))
- {
- if (!route.StartsWith(routePrefix))
- {
- route = $"{routePrefix}/" + route;
- }
-
- route = "/" + route;
- }
-
- endpoint.Route = new HttpRoute(route);
- }
- else
- {
- if (!string.IsNullOrEmpty(routePrefix))
- {
- endpoint.Route = new HttpRoute($"{routePrefix}/{endpoint.Name}");
- }
- else
- {
- endpoint.Route = new HttpRoute($"{endpoint.Name}");
- }
- }
-
-
- var expectedBodyParameters = attributes.GetAttributes()
- .Select(x => new ExpectedBodyParamterDefinition(x))
- .GroupBy(x => x.Method)
- .ToDictionary(x => x.Key, y => y.Select(z => (IParameter)new BodyParameter("body", z.Type, null)));
-
- var expectedQueryParameters = attributes.GetAttributes()
- .Select(x => new ExpectedQueryParamterDefinition(x))
- .GroupBy(x => x.Method)
- .ToDictionary(x => x.Key, y => y.Select(z => (IParameter)new QueryParameter(z.Name, z.Type, null, z.IsQueryObject)));
-
- endpoint.HttpParameters = expectedBodyParameters.Union(expectedQueryParameters).ToDictionary();
-
- var parameters = syntax.ParameterList.Parameters.Select(x => new ParameterDefinition(x, endpoint.GetFullRoute())).ToList();
-
- var routeParams = parameters.Where(x => x.Options.FromRoute).Select(x => new RouteParameter(x.RouteName, x.Type, x.Default)).ToList();
-
- endpoint.Parameters = routeParams.Cast().NotNull().ToList();
-
- endpoint.Parameters.Add(new CancellationTokenModifier());
- endpoint.Parameters.Add(new CookieModifier());
- endpoint.Parameters.Add(new HeadersModifier());
- endpoint.Parameters.Add(new TimeoutModifier());
-
- if (triggerAttribute.AuthLevel == AuthorizationLevel.User)
- {
- if (!endpoint.ResponseTypes.Any(x => x.Status == HttpStatusCode.Unauthorized))
- {
- endpoint.ResponseTypes.Add(new ResponseType(HttpStatusCode.Unauthorized));
- }
-
- endpoint.Parameters.Add(new SecurityModifier());
- }
- else if (triggerAttribute.AuthLevel == AuthorizationLevel.Anonymous)
- {
-
- }
- else
- {
- if (!endpoint.ResponseTypes.Any(x => x.Status == HttpStatusCode.Unauthorized))
- {
- endpoint.ResponseTypes.Add(new ResponseType(HttpStatusCode.Unauthorized));
- }
-
- endpoint.Parameters.Add(new FunctionAuthModifier());
- }
-
-
- var parameterHeaders = attributes.GetAttributes()
- .Select(x => new ParameterHeaderDefinition(x))
- .ToList();
- endpoint.ParameterHeader = parameterHeaders.Select(x => new ParameterHeader(x.Name, x.Type, x.DefaultValue)).ToList();
-
-
-
- var headers = attributes.GetAttributes()
- .Select(x => new HeaderDefinition(x))
- .ToList();
- endpoint.ConstantHeader = headers.Select(x => new ConstantHeader(x.Name, x.Value)).ToList();
-
-
- var rawReturnType = syntax.ReturnType?.ToFullString();
-
- var returnType = Helpers.GetTypeFromString(rawReturnType.Trim());
-
- while (returnType.IsContainerReturnType())
- {
- returnType = returnType.Arguments.SingleOrDefault();
- }
-
- if (Helpers.IsType(typeof(IActionResult).FullName, returnType?.Name))
- {
- returnType = null;
- }
-
- if (returnType?.Name == "void"
- || (Helpers.IsType(typeof(Task).FullName, returnType?.Name) && (!returnType?.Arguments.Any() ?? false)))
- {
- returnType = null;
- }
-
- if (returnType.IsFileReturnType())
- {
- returnType = new Helpers.TypeString(typeof(Stream).FullName);
- endpoint.ReturnsStream = true;
- }
-
- rawReturnType = returnType?.ToString();
-
- endpoint.ReturnType = rawReturnType?.Trim();
-
- foreach (var method in endpoint.SupportedMethods)
- {
- var duplicateParameters = endpoint.GetParametersWithoutResponseTypesForHttpMethod(method).GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
-
- if (duplicateParameters.Any())
- {
- throw new NotSupportedException($"Function has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
- }
-
-
- var invalidParameters = endpoint.GetParametersForHttpMethod(method).Where(x => !Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsValidIdentifier(x.Name)).ToList();
-
- if (invalidParameters.Any())
- {
- throw new NotSupportedException($"Function {endpoint.Name} has parameters that are invalid variable names. {string.Join(", ", invalidParameters.Select(x => x.Name))}");
- }
- }
- }
- catch (NotSupportedException nse)
- {
- if (endpoint.Ignored)
- {
- return endpoint;
- }
-
- endpoint.Failed = true;
- endpoint.Error = nse.Message;
- }
-#if !DEBUG
- catch (Exception ex)
- {
- endpoint.Failed = true;
- endpoint.UnexpectedFailure = true;
- endpoint.Error = ex.ToString();
- }
-#endif
-
-
- return endpoint;
- }
-
- #endregion
- }
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text.RegularExpressions;
+using System.Threading.Channels;
+using System.Threading.Tasks;
+using Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreFunctions;
+using Beffyman.AspNetCore.Client.Generator.CSharp.AspNetCoreHttp;
+using Beffyman.AspNetCore.Client.Generator.CSharp.SignalR;
+using Beffyman.AspNetCore.Client.Generator.Framework;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes;
+using Beffyman.AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
+using Beffyman.AspNetCore.Client.Generator.Framework.RequestModifiers;
+using Beffyman.AspNetCore.Client.Generator.Framework.SignalR;
+using Beffyman.AspNetCore.Client.Generator.SignalR;
+using AspNetCore.Server.Attributes;
+using AspNetCore.Server.Attributes.Functions;
+using AspNetCore.Server.Attributes.Http;
+using AspNetCore.Server.Attributes.SignalR;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Azure.WebJobs;
+using Microsoft.Azure.WebJobs.Extensions.Http;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace Beffyman.AspNetCore.Client.Generator.Output
+{
+ public static class ClassParser
+ {
+ private static readonly Regex RouteVersionRegex = new Regex(@"\/([v|V]\d+)\/");
+
+ #region Http
+
+ public static AspNetCoreHttpController ReadClassAsHttpController(ClassDeclarationSyntax syntax)
+ {
+ var attributes = syntax.AttributeLists.SelectMany(x => x.Attributes).ToList();
+
+
+ var controller = new AspNetCoreHttpController();
+ try
+ {
+ controller.Name = $@"{syntax.Identifier.ValueText.Trim().Replace("Controller", "")}";
+
+ controller.Abstract = syntax.Modifiers.Any(x => x.Text == "abstract");
+
+ if (syntax.BaseList == null)
+ {
+ controller.Ignored = true;
+ return controller;
+ }
+
+ controller.BaseClass = syntax.BaseList.Types.Where(x => x.ToFullString().Trim().EndsWith("Controller")).SingleOrDefault()?.ToFullString().Trim().Replace("Controller", "");
+
+ controller.Ignored = attributes.HasAttribute();
+
+
+ var namespaceAttribute = attributes.GetAttribute();
+ if (namespaceAttribute != null)
+ {
+ controller.NamespaceSuffix = namespaceAttribute.GetAttributeValue();
+ }
+
+ var routeAttribute = attributes.GetAttribute();
+ if (routeAttribute != null)//Fetch route from RouteAttribute
+ {
+ controller.Route = new HttpRoute(routeAttribute.GetAttributeValue());
+ }
+
+ if (controller.Route == null && !controller.Abstract && !controller.Ignored)//No Route, invalid controller
+ {
+ controller.Ignored = true;
+ throw new NotSupportedException("Controller must have a route to be valid for generation.");
+ }
+
+ if (controller.Route != null)
+ {
+ var match = RouteVersionRegex.Match(controller.Route.Value);
+ if (match.Success)
+ {
+ var group = match.Groups[1];
+ controller.NamespaceVersion = group.Value.ToUpper();
+ }
+ }
+ else
+ {
+ controller.Route = new HttpRoute(string.Empty);
+ }
+
+ var versionAttribute = attributes.GetAttribute(Constants.ApiVersionAttribute);
+ if (versionAttribute != null)
+ {
+ var version = new ApiVersionDefinition(versionAttribute);
+
+ controller.NamespaceVersion = $"V{version.Version.Replace(".", "_")}";
+
+ var versionConstraint = controller.Route.Constraints.OfType().SingleOrDefault();
+ if (versionConstraint != null)
+ {
+ controller.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, false);
+ }
+ else
+ {
+ controller.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, true);
+ }
+ }
+
+ //Response types
+ var responseTypes = attributes.GetAttributes();
+ var responses = responseTypes.Select(x => new ResponseTypeDefinition(x)).ToList();
+ controller.ResponseTypes = responses.Select(x => new ResponseType(x.Type, Helpers.EnumParse(x.StatusValue))).ToList();
+
+
+
+ var parameterHeaders = attributes.GetAttributes()
+ .Select(x => new ParameterHeaderDefinition(x))
+ .ToList();
+ controller.ParameterHeader = parameterHeaders.Select(x => new ParameterHeader(x.Name, x.Type, x.DefaultValue)).ToList();
+
+
+
+ var headers = attributes.GetAttributes()
+ .Select(x => new HeaderDefinition(x))
+ .ToList();
+ controller.ConstantHeader = headers.Select(x => new ConstantHeader(x.Name, x.Value)).ToList();
+
+ //Authorize Attribute
+ controller.IsSecured = attributes.HasAttribute();
+
+ //Obsolete Attribute
+ var obsoleteAttribute = attributes.GetAttribute();
+ if (obsoleteAttribute != null)
+ {
+ controller.Obsolete = true;
+ controller.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
+ }
+
+ //Only public endpoints can be hit anyways
+ var methods = syntax.DescendantNodes().OfType()
+ .Where(x => x.Modifiers.Any(y => y.Text == "public"))
+ .ToList();
+ controller.Endpoints = methods.Select(x => ReadMethodAsHttpEndpoint(controller, x)).ToList();
+
+ if (!controller.Endpoints.Any(x => !x.Ignored)
+ && controller.Endpoints.Count > 0
+ && !controller.Abstract)
+ {
+ controller.Ignored = true;
+ }
+ }
+ catch (NotSupportedException nse)
+ {
+ if (controller.Ignored)
+ {
+ return controller;
+ }
+
+ controller.Failed = true;
+ controller.Error = nse.Message;
+ }
+#if !DEBUG
+ catch (Exception ex)
+ {
+ controller.Failed = true;
+ controller.UnexpectedFailure = true;
+ controller.Error = ex.ToString();
+ }
+#endif
+ return controller;
+ }
+
+
+ private static AspNetCoreHttpEndpoint ReadMethodAsHttpEndpoint(AspNetCoreHttpController parent, MethodDeclarationSyntax syntax)
+ {
+ var attributes = syntax.DescendantNodes().OfType().SelectMany(x => x.Attributes).ToList();
+
+ var endpoint = new AspNetCoreHttpEndpoint(parent);
+
+ endpoint.Name = syntax.Identifier.ValueText.Trim();
+ endpoint.FormattedName = syntax.Identifier.ValueText.CleanMethodName();
+
+
+ endpoint.Virtual = syntax.Modifiers.Any(x => x.Text == "virtual");
+ endpoint.Override = syntax.Modifiers.Any(x => x.Text == "override");
+ endpoint.New = syntax.Modifiers.Any(x => x.Text == "new");
+
+
+ //Ignore generator attribute
+ endpoint.Ignored = attributes.HasAttribute();
+
+
+ //Route Attribute
+
+ var routeAttribute = attributes.GetAttribute();
+ if (routeAttribute != null)//Fetch route from RouteAttribute
+ {
+ endpoint.Route = new HttpRoute(routeAttribute.GetAttributeValue());
+ }
+
+
+ //HTTP Attribute
+ var knownHttpAttributes = new List
+ {
+ $"{Constants.Http}{HttpAttributeType.Delete}",
+ $"{Constants.Http}{HttpAttributeType.Get}",
+ $"{Constants.Http}{HttpAttributeType.Patch}",
+ $"{Constants.Http}{HttpAttributeType.Post}",
+ $"{Constants.Http}{HttpAttributeType.Put}",
+ };
+
+ var httpAttribute = attributes.SingleOrDefault(x => knownHttpAttributes.Any(y => x.Name.ToFullString().MatchesAttribute(y)));
+ if (httpAttribute == null)
+ {
+ endpoint.Ignored = true;
+ }
+ else
+ {
+ var httpType = (HttpAttributeType)Enum.Parse(typeof(HttpAttributeType),
+ httpAttribute.Name
+ .ToFullString()
+ .Replace(Constants.Http, "")
+ .Replace(Constants.Attribute, ""));
+
+ endpoint.HttpType = Helpers.HttpMethodFromEnum(httpType);
+ }
+
+
+
+ if (endpoint.Route == null && httpAttribute?.ArgumentList != null)//If Route was never fetched from RouteAttribute or if they used the Http(template) override
+ {
+ endpoint.Route = new HttpRoute(httpAttribute.GetAttributeValue());
+ }
+
+ //Ignore method if it doesn't have a route or http attribute
+ if (endpoint.Route == null && httpAttribute == null)
+ {
+ endpoint.Ignored = true;
+ return endpoint;
+ }
+
+ if (endpoint.Route == null)
+ {
+ endpoint.Route = new HttpRoute(string.Empty);
+ }
+
+ var versionAttribute = attributes.GetAttribute(Constants.ApiVersionAttribute);
+ if (versionAttribute != null)
+ {
+ var version = new ApiVersionDefinition(versionAttribute);
+
+ var versionConstraint = endpoint.Route.Constraints.OfType().SingleOrDefault();
+ if (versionConstraint != null)
+ {
+ endpoint.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, false);
+ }
+ else
+ {
+ endpoint.Route.Version = new Framework.AspNetCoreHttp.Routes.ApiVersion(version.Version, true);
+ }
+ }
+
+
+ if (endpoint.Route.Version != null && parent.Route.Version != null)
+ {
+ throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has {Constants.ApiVersionAttribute} on both it's method and class");
+ }
+
+ //Obsolete Attribute
+ var obsoleteAttribute = attributes.GetAttribute();
+ if (obsoleteAttribute != null)
+ {
+ endpoint.Obsolete = true;
+ endpoint.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
+ }
+
+ //Authorize Attribute
+ endpoint.IsSecured = attributes.HasAttribute();
+
+
+ //Response types
+ var responseTypes = attributes.GetAttributes();
+ var responses = responseTypes.Select(x => new ResponseTypeDefinition(x)).ToList();
+ responses.Add(new ResponseTypeDefinition(true));
+
+ endpoint.ResponseTypes = responses.Select(x => new ResponseType(x.Type, Helpers.EnumParse(x.StatusValue))).ToList();
+
+ var duplicateResponseTypes = endpoint.GetResponseTypes().GroupBy(x => x.Status).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateResponseTypes.Any())
+ {
+ throw new NotSupportedException($"Endpoint has multiple response types of the same status defined. {string.Join(", ", duplicateResponseTypes.Select(x => x.Key?.ToString()))}");
+ }
+ //Add after so we don't get duplicate error from the null Status
+ endpoint.ResponseTypes.Add(new ExceptionResponseType());
+
+
+
+
+ var parameters = syntax.ParameterList.Parameters.Select(x => new ParameterDefinition(x, endpoint.GetFullRoute(parent))).Where(x => !x.Invalid).ToList();
+
+
+ var routeParams = parameters.Where(x => x.Options.FromRoute).Select(x => new RouteParameter(x.RouteName, x.Type, x.Default)).ToList();
+ var queryParams = parameters.Where(x => x.Options.FromQuery).Select(x => new QueryParameter(x.Options.QueryName, x.Type, x.Default, x.Options.QueryObject)).ToList();
+ var bodyParam = parameters.Where(x => x.Options.FromBody).Select(x => new BodyParameter(x.Name, x.Type, x.Default)).SingleOrDefault();
+
+
+ endpoint.Parameters = routeParams.Cast().Union(queryParams).Union(new List { bodyParam }).NotNull().ToList();
+
+ endpoint.Parameters.Add(new CancellationTokenModifier());
+ endpoint.Parameters.Add(new CookieModifier());
+ endpoint.Parameters.Add(new HeadersModifier());
+ endpoint.Parameters.Add(new TimeoutModifier());
+ if (endpoint.IsSecured)
+ {
+ endpoint.Parameters.Add(new SecurityModifier());
+ }
+
+
+ var parameterHeaders = attributes.GetAttributes()
+ .Select(x => new ParameterHeaderDefinition(x))
+ .ToList();
+ endpoint.ParameterHeader = parameterHeaders.Select(x => new ParameterHeader(x.Name, x.Type, x.DefaultValue)).ToList();
+
+
+
+ var headers = attributes.GetAttributes()
+ .Select(x => new HeaderDefinition(x))
+ .ToList();
+ endpoint.ConstantHeader = headers.Select(x => new ConstantHeader(x.Name, x.Value)).ToList();
+
+
+ var rawReturnType = syntax.ReturnType?.ToFullString();
+
+ var returnType = Helpers.GetTypeFromString(rawReturnType.Trim());
+
+ while (returnType.IsContainerReturnType())
+ {
+ returnType = returnType.Arguments.SingleOrDefault();
+ }
+
+ if (Helpers.IsType(typeof(IActionResult).FullName, returnType?.Name))
+ {
+ returnType = null;
+ }
+
+ if (returnType?.Name == "void"
+ || (Helpers.IsType(typeof(Task).FullName, returnType?.Name) && (!returnType?.Arguments.Any() ?? false)))
+ {
+ returnType = null;
+ }
+
+ if (returnType.IsFileReturnType())
+ {
+ returnType = new Helpers.TypeString(typeof(Stream).FullName);
+ endpoint.ReturnsStream = true;
+ }
+
+ rawReturnType = returnType?.ToString();
+
+ endpoint.ReturnType = rawReturnType?.Trim();
+
+ var okStatus = endpoint.ResponseTypes.SingleOrDefault(x => x.Status == HttpStatusCode.OK);
+
+ if (okStatus != null
+ && endpoint.ReturnType != null
+ && Helpers.IsType(okStatus.ActionType, endpoint.ReturnType))
+ {
+ //Remove the OkStatus since it is the same as the method return
+ endpoint.ResponseTypes.Remove(okStatus);
+ }
+ else if (okStatus != null
+ && endpoint.ReturnType != null
+ && !Helpers.IsType(okStatus.ActionType, endpoint.ReturnType))
+ {
+ throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has a OK response type of {okStatus.ActionType}, but the method return {endpoint.ReturnType}");
+ }
+
+ var duplicateParameters = endpoint.GetParametersWithoutResponseTypes().GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateParameters.Any())
+ {
+ throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
+ }
+
+ var invalidParameters = endpoint.GetParameters().Where(x => !Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsValidIdentifier(x.Name)).ToList();
+
+ if (invalidParameters.Any())
+ {
+ throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.FormattedName} has parameters that are invalid variable names. {string.Join(", ", invalidParameters.Select(x => x.Name))}");
+ }
+
+ var fullRoute = endpoint.GetFullRoute(parent);
+ if (fullRoute?.Version?.Query ?? false)
+ {
+ endpoint.Parameters.Add(new QueryParameter($"api-version={fullRoute?.Version}"));
+ }
+
+
+ return endpoint;
+ }
+
+ #endregion Http
+
+
+ #region SignalR
+
+ public static HubController ReadClassAsHubController(ClassDeclarationSyntax syntax)
+ {
+ var attributes = syntax.AttributeLists.SelectMany(x => x.Attributes).ToList();
+
+ var controller = new HubController();
+ try
+ {
+ controller.Name = $@"{syntax.Identifier.ValueText.Trim().Replace("Hub", "")}";
+
+ controller.Abstract = syntax.Modifiers.Any(x => x.Text == "abstract");
+
+ if (syntax.BaseList == null)
+ {
+ controller.Ignored = true;
+ return controller;
+ }
+
+ var generatedAttribute = attributes.GetAttribute();
+ if (generatedAttribute == null)
+ {
+ controller.Ignored = true;
+ return controller;
+ }
+
+ controller.BaseClass = syntax.BaseList.Types.Where(x => x.ToFullString().Trim().EndsWith("Hub")).SingleOrDefault()?.ToFullString().Trim().Replace("Hub", "");
+
+ controller.Ignored = attributes.HasAttribute();
+
+
+ var namespaceAttribute = attributes.GetAttribute();
+ if (namespaceAttribute != null)
+ {
+ controller.NamespaceSuffix = namespaceAttribute.ArgumentList.Arguments.ToFullString().Replace("\"", "");
+ }
+
+ var routeAttribute = attributes.GetAttribute();
+ if (routeAttribute != null)//Fetch route from RouteAttribute
+ {
+ controller.Route = routeAttribute.ArgumentList.Arguments.ToFullString().Replace("\"", "");
+ }
+
+ if (controller.Route == null && !controller.Abstract && !controller.Ignored)//No Route, invalid controller
+ {
+ controller.Ignored = true;
+ throw new NotSupportedException("Controller must have a route to be valid for generation.");
+ }
+
+ if (controller.Route != null)
+ {
+ var match = RouteVersionRegex.Match(controller.Route);
+ if (match.Success)
+ {
+ var group = match.Groups[1];
+ controller.NamespaceVersion = group.Value.ToUpper();
+ }
+ }
+
+ //Obsolete Attribute
+ var obsoleteAttribute = attributes.GetAttribute();
+ if (obsoleteAttribute != null)
+ {
+ controller.Obsolete = true;
+ controller.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
+ }
+
+ //Only public endpoints can be hit anyways
+ var methods = syntax.DescendantNodes().OfType()
+ .Where(x => x.Modifiers.Any(y => y.Text == "public"))
+ .ToList();
+ controller.Endpoints = methods.Select(x => ReadMethodAsHubEndpoint(controller, x)).ToList();
+
+ if (!controller.Endpoints.Any(x => !x.Ignored))
+ {
+ controller.Ignored = true;
+ }
+ }
+ catch (NotSupportedException nse)
+ {
+ if (controller.Ignored)
+ {
+ return controller;
+ }
+
+ controller.Failed = true;
+ controller.Error = nse.Message;
+ }
+#if !DEBUG
+ catch (Exception ex)
+ {
+ controller.Failed = true;
+ controller.UnexpectedFailure = true;
+ controller.Error = ex.ToString();
+ }
+#endif
+ return controller;
+ }
+
+
+
+ private static HubEndpoint ReadMethodAsHubEndpoint(HubController parent, MethodDeclarationSyntax syntax)
+ {
+ var attributes = syntax.DescendantNodes().OfType().SelectMany(x => x.Attributes).ToList();
+
+ var endpoint = new HubEndpoint(parent);
+
+ endpoint.Name = syntax.Identifier.ValueText.CleanMethodName();
+
+
+ endpoint.Virtual = syntax.Modifiers.Any(x => x.Text == "virtual");
+ endpoint.Override = syntax.Modifiers.Any(x => x.Text == "override");
+ endpoint.New = syntax.Modifiers.Any(x => x.Text == "new");
+
+
+ //Ignore generator attribute
+ endpoint.Ignored = attributes.HasAttribute();
+
+ //Obsolete Attribute
+ var obsoleteAttribute = attributes.GetAttribute();
+ if (obsoleteAttribute != null)
+ {
+ endpoint.Obsolete = true;
+ endpoint.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
+ }
+
+ //Response types
+ var messageAttributes = attributes.GetAttributes();
+ var messages = messageAttributes.Select(x => new MessageDefinition(x)).ToList();
+
+ endpoint.Messages = messages.Select(x => new Message(x.Name, x.Types)).ToList();
+
+ var duplicateMessages = endpoint.Messages.GroupBy(x => x.Name).Where(x => x.Count() > 1 && !x.All(y => y.Types.SequenceEqual(x.First().Types))).ToList();
+
+ if (duplicateMessages.Any())
+ {
+ throw new NotSupportedException($"Hub has the same message with different parameters defined on different endpoints. {string.Join(", ", duplicateMessages.Select(x => x.Key?.ToString()))}");
+ }
+
+
+
+
+ var parameters = syntax.ParameterList.Parameters.Select(x => new HubParameterDefinition(x)).Where(x => !x.Invalid).ToList();
+ var hubParams = parameters.Select(x => new HubParameter(x.Name, x.Type, x.Default)).ToList();
+
+ endpoint.Parameters = hubParams.Cast().NotNull().ToList();
+
+ var duplicateParameters = endpoint.GetParameters().GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateParameters.Any())
+ {
+ throw new NotSupportedException($"Endpoint has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
+ }
+
+ var invalidParameters = endpoint.GetParameters().Where(x => !Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsValidIdentifier(x.Name)).ToList();
+
+ if (invalidParameters.Any())
+ {
+ throw new NotSupportedException($"Endpoint {parent.Name}.{endpoint.Name} has parameters that are invalid variable names. {string.Join(", ", invalidParameters.Select(x => x.Name))}");
+ }
+
+
+ var rawReturnType = syntax.ReturnType?.ToFullString();
+
+ var returnType = Helpers.GetTypeFromString(rawReturnType.Trim());
+
+ while (returnType.IsContainerReturnType())
+ {
+ returnType = returnType.Arguments.SingleOrDefault();
+ }
+
+ if (Helpers.IsType(typeof(ChannelReader<>).FullName.CleanGenericTypeDefinition(), returnType?.Name))
+ {
+ endpoint.Channel = true;
+ endpoint.ChannelType = returnType.Arguments.SingleOrDefault().ToString();
+ }
+
+
+ return endpoint;
+ }
+
+
+
+
+ #endregion SignalR
+
+
+ #region Functions
+
+ public static FunctionEndpoint ReadMethodAsFunction(MethodDeclarationSyntax syntax, HostJson hostData)
+ {
+ var attributes = syntax.DescendantNodes().OfType().SelectMany(x => x.Attributes).ToList();
+
+ var endpoint = new FunctionEndpoint();
+ try
+ {
+ var endpointName = attributes.GetAttribute();
+
+ if (endpointName == null)
+ {
+ endpoint.Ignored = true;
+ return endpoint;
+ }
+
+ endpoint.Name = endpointName.GetAttributeValue();
+
+ //Ignore generator attribute
+ endpoint.Ignored = attributes.HasAttribute();
+
+
+ //Obsolete Attribute
+ var obsoleteAttribute = attributes.GetAttribute();
+ if (obsoleteAttribute != null)
+ {
+ endpoint.Obsolete = true;
+ endpoint.ObsoleteMessage = obsoleteAttribute.GetAttributeValue();
+ }
+
+ //Response types
+ var responseTypes = attributes.GetAttributes();
+ var responses = responseTypes.Select(x => new ResponseTypeDefinition(x)).ToList();
+ responses.Add(new ResponseTypeDefinition(true));
+
+ endpoint.ResponseTypes = responses.Select(x => new ResponseType(x.Type, Helpers.EnumParse(x.StatusValue))).ToList();
+
+ var duplicateResponseTypes = endpoint.GetResponseTypes().GroupBy(x => x.Status).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateResponseTypes.Any())
+ {
+ throw new NotSupportedException($"Endpoint has multiple response types of the same status defined. {string.Join(", ", duplicateResponseTypes.Select(x => x.Key?.ToString()))}");
+ }
+ //Add after so we don't get duplicate error from the null Status
+ endpoint.ResponseTypes.Add(new ExceptionResponseType());
+
+
+ //Need to check if the function has a HttpTrigger
+ var httpTriggerAttribute = syntax.ParameterList.Parameters.SingleOrDefault(x => x.AttributeLists.SelectMany(y => y.Attributes).HasAttribute());
+
+ if (httpTriggerAttribute == null)
+ {
+ endpoint.Ignored = true;
+ return endpoint;
+ }
+
+ var triggerAttribute = new HttpTriggerParameter(httpTriggerAttribute);
+
+ endpoint.SupportedMethods = triggerAttribute.Methods;
+
+ var routePrefix = hostData?.http?.routePrefix ?? "api";
+
+ if (triggerAttribute.Route != null)
+ {
+ var route = triggerAttribute.Route.TrimStart('/');
+
+ if (!string.IsNullOrEmpty(routePrefix))
+ {
+ if (!route.StartsWith(routePrefix))
+ {
+ route = $"{routePrefix}/" + route;
+ }
+
+ route = "/" + route;
+ }
+
+ endpoint.Route = new HttpRoute(route);
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(routePrefix))
+ {
+ endpoint.Route = new HttpRoute($"{routePrefix}/{endpoint.Name}");
+ }
+ else
+ {
+ endpoint.Route = new HttpRoute($"{endpoint.Name}");
+ }
+ }
+
+
+ var expectedBodyParameters = attributes.GetAttributes()
+ .Select(x => new ExpectedBodyParamterDefinition(x))
+ .GroupBy(x => x.Method)
+ .ToDictionary(x => x.Key, y => y.Select(z => (IParameter)new BodyParameter("body", z.Type, null)));
+
+ var expectedQueryParameters = attributes.GetAttributes()
+ .Select(x => new ExpectedQueryParamterDefinition(x))
+ .GroupBy(x => x.Method)
+ .ToDictionary(x => x.Key, y => y.Select(z => (IParameter)new QueryParameter(z.Name, z.Type, null, z.IsQueryObject)));
+
+ endpoint.HttpParameters = expectedBodyParameters.Union(expectedQueryParameters).ToDictionary();
+
+ var parameters = syntax.ParameterList.Parameters.Select(x => new ParameterDefinition(x, endpoint.GetFullRoute())).Where(x => !x.Invalid).ToList();
+
+ var routeParams = parameters.Where(x => x.Options.FromRoute).Select(x => new RouteParameter(x.RouteName, x.Type, x.Default)).ToList();
+
+ endpoint.Parameters = routeParams.Cast().NotNull().ToList();
+
+ endpoint.Parameters.Add(new CancellationTokenModifier());
+ endpoint.Parameters.Add(new CookieModifier());
+ endpoint.Parameters.Add(new HeadersModifier());
+ endpoint.Parameters.Add(new TimeoutModifier());
+
+ if (triggerAttribute.AuthLevel == AuthorizationLevel.User)
+ {
+ if (!endpoint.ResponseTypes.Any(x => x.Status == HttpStatusCode.Unauthorized))
+ {
+ endpoint.ResponseTypes.Add(new ResponseType(HttpStatusCode.Unauthorized));
+ }
+
+ endpoint.Parameters.Add(new SecurityModifier());
+ }
+ else if (triggerAttribute.AuthLevel == AuthorizationLevel.Anonymous)
+ {
+
+ }
+ else
+ {
+ if (!endpoint.ResponseTypes.Any(x => x.Status == HttpStatusCode.Unauthorized))
+ {
+ endpoint.ResponseTypes.Add(new ResponseType(HttpStatusCode.Unauthorized));
+ }
+
+ endpoint.Parameters.Add(new FunctionAuthModifier());
+ }
+
+
+ var parameterHeaders = attributes.GetAttributes()
+ .Select(x => new ParameterHeaderDefinition(x))
+ .ToList();
+ endpoint.ParameterHeader = parameterHeaders.Select(x => new ParameterHeader(x.Name, x.Type, x.DefaultValue)).ToList();
+
+
+
+ var headers = attributes.GetAttributes()
+ .Select(x => new HeaderDefinition(x))
+ .ToList();
+ endpoint.ConstantHeader = headers.Select(x => new ConstantHeader(x.Name, x.Value)).ToList();
+
+
+ var rawReturnType = syntax.ReturnType?.ToFullString();
+
+ var returnType = Helpers.GetTypeFromString(rawReturnType.Trim());
+
+ while (returnType.IsContainerReturnType())
+ {
+ returnType = returnType.Arguments.SingleOrDefault();
+ }
+
+ if (Helpers.IsType(typeof(IActionResult).FullName, returnType?.Name))
+ {
+ returnType = null;
+ }
+
+ if (returnType?.Name == "void"
+ || (Helpers.IsType(typeof(Task).FullName, returnType?.Name) && (!returnType?.Arguments.Any() ?? false)))
+ {
+ returnType = null;
+ }
+
+ if (returnType.IsFileReturnType())
+ {
+ returnType = new Helpers.TypeString(typeof(Stream).FullName);
+ endpoint.ReturnsStream = true;
+ }
+
+ rawReturnType = returnType?.ToString();
+
+ endpoint.ReturnType = rawReturnType?.Trim();
+
+ foreach (var method in endpoint.SupportedMethods)
+ {
+ var duplicateParameters = endpoint.GetParametersWithoutResponseTypesForHttpMethod(method).GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList();
+
+ if (duplicateParameters.Any())
+ {
+ throw new NotSupportedException($"Function has multiple parameters of the same name defined. {string.Join(", ", duplicateParameters.Select(x => x.Key?.ToString()))}");
+ }
+
+
+ var invalidParameters = endpoint.GetParametersForHttpMethod(method).Where(x => !Microsoft.CodeAnalysis.CSharp.SyntaxFacts.IsValidIdentifier(x.Name)).ToList();
+
+ if (invalidParameters.Any())
+ {
+ throw new NotSupportedException($"Function {endpoint.Name} has parameters that are invalid variable names. {string.Join(", ", invalidParameters.Select(x => x.Name))}");
+ }
+ }
+ }
+ catch (NotSupportedException nse)
+ {
+ if (endpoint.Ignored)
+ {
+ return endpoint;
+ }
+
+ endpoint.Failed = true;
+ endpoint.Error = nse.Message;
+ }
+#if !DEBUG
+ catch (Exception ex)
+ {
+ endpoint.Failed = true;
+ endpoint.UnexpectedFailure = true;
+ endpoint.Error = ex.ToString();
+ }
+#endif
+
+
+ return endpoint;
+ }
+
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/src/AspNetCore.Client.Generator/Output/ClassWriter.cs b/src/Beffyman.AspNetCore.Client.Generator/Output/ClassWriter.cs
similarity index 92%
rename from src/AspNetCore.Client.Generator/Output/ClassWriter.cs
rename to src/Beffyman.AspNetCore.Client.Generator/Output/ClassWriter.cs
index 7baa3e3..f377648 100644
--- a/src/AspNetCore.Client.Generator/Output/ClassWriter.cs
+++ b/src/Beffyman.AspNetCore.Client.Generator/Output/ClassWriter.cs
@@ -1,2011 +1,2022 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Net.Http;
-using AspNetCore.Client.Generator.Framework;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Dependencies;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Functions;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Headers;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Parameters;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.RequestModifiers;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.ResponseTypes;
-using AspNetCore.Client.Generator.Framework.AspNetCoreHttp.Routes.Constraints;
-using AspNetCore.Client.Generator.Framework.AttributeInterfaces;
-using AspNetCore.Client.Generator.Framework.RequestModifiers;
-using AspNetCore.Client.Generator.Framework.SignalR;
-using Flurl.Http;
-using Microsoft.AspNetCore.Routing.Template;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace AspNetCore.Client.Generator.Output
-{
- public static class ClassWriter
- {
- public static void WriteClientsFile(GenerationContext context)
- {
- var files = WriteFiles(context);
-
-
- var generatorUsings = new List();
-
- if (context.HubEndpoints.Any(x => !x.Ignored))
- {
- generatorUsings.Add("//Requires nuget Microsoft.AspNetCore.SignalR.Client");
- generatorUsings.Add("//Requires nuget System.Threading.Channels");
- generatorUsings.Add("//Requires nuget Microsoft.Extensions.Logging");
- generatorUsings.Add("using Microsoft.AspNetCore.SignalR.Client;");
- generatorUsings.Add("using Microsoft.AspNetCore.SignalR.Protocol;");
- generatorUsings.Add("using System.Threading.Channels;");
- generatorUsings.Add("using Microsoft.AspNetCore.Http.Connections;");
- generatorUsings.Add("using Microsoft.AspNetCore.Http.Connections.Client;");
- generatorUsings.Add("using Microsoft.Extensions.Logging;");
- }
-
- var usings = new List
- {
- @"using AspNetCore.Client;",
- "using AspNetCore.Client.Authorization;",
- "using AspNetCore.Client.Exceptions;",
- "using AspNetCore.Client.Http;",
- "using AspNetCore.Client.RequestModifiers;",
- "using AspNetCore.Client.Serializers;",
- "using Flurl.Http;",
- "using Microsoft.Extensions.DependencyInjection;",
- "using System;",
- "using System.Linq;",
- "using System.Collections.Generic;",
- "using System.Net;",
- "using System.Net.Http;",
- "using System.Runtime.CompilerServices;",
- "using System.Threading;",
- "using System.Threading.Tasks;",
- "using System.IO;",
- "using AspNetCore.Client.GeneratorExtensions;"
- }
- .Union(context.UsingStatements)
- .Union(generatorUsings)
- .Distinct()
- .OrderBy(x => x)
- .ToList();
-
- var fileHeader =
-$@"//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-{string.Join(Environment.NewLine, usings)}
-";
- //Can also probably make the split into file per controller
-
- if (Settings.MultipleFiles)
- {
- foreach (var fil in files)
- {
- if (fil.Value == null)
- {
- Helpers.SafelyDeleteFile($"{Environment.CurrentDirectory}/{fil.Key}.cs");
- continue;
- }
-
-
- var file = fileHeader + fil.Value;
-
- var syntaxTree = CSharpSyntaxTree.ParseText(file, new CSharpParseOptions(LanguageVersion.Latest, DocumentationMode.None, SourceCodeKind.Regular));
- file = syntaxTree.GetRoot().NormalizeWhitespace(" ", false).ToFullString();
- Helpers.SafelyWriteToFile($"{Environment.CurrentDirectory}/{fil.Key}.cs", file);
- }
- }
- else
- {
- var file = fileHeader + string.Join(Environment.NewLine, files.Values.NotNull());
-
- var syntaxTree = CSharpSyntaxTree.ParseText(file, new CSharpParseOptions(LanguageVersion.Latest, DocumentationMode.None, SourceCodeKind.Regular));
- file = syntaxTree.GetRoot().NormalizeWhitespace(" ", false).ToFullString();
- Helpers.SafelyWriteToFile($"{Environment.CurrentDirectory}/Clients.cs", file);
- }
- }
-
- public static IDictionary WriteFiles(GenerationContext context)
- {
- Dictionary files = new Dictionary();
-
- if (Settings.GenerateStaticRoutes)
- {
- files.Add("Routes", SharedWriter.WriteStaticRoutes(context));
- }
- else
- {
- files.Add("Routes", null);
- }
-
- files.Add("Installer", SharedWriter.WriteInstallFile(context));
-
- if (context.HttpClients.Any(x => x.Generated))
- {
- files.Add("Clients", HttpClassWriter.WriteVersionBlocks(context));
- }
- else
- {
- files.Add("Clients", null);
- }
-
- if (context.Functions.Any(x => x.Generated))
- {
- files.Add("Functions", FunctionClassWriter.WriteBlocks(context));
- }
- else
- {
- files.Add("Functions", null);
- }
-
- if (context.HubClients.Any(x => x.Generated))
- {
- files.Add("Hubs", SignalRClassWriter.WriteVersionBlocks(context));
- }
- else
- {
- files.Add("Hubs", null);
- }
-
- return files;
- }
- }
-
- #region SignalR
-
- public static class SignalRClassWriter
- {
- public static string WriteErrorMessage(HubController controller)
- {
- if (controller.Failed)
- {
- return $@"{(controller.UnexpectedFailure ? "#error PLEASE MAKE A GITHUB REPO ISSUE" : "#warning")} {controller.Name}Hub {(controller.UnexpectedFailure ? "has failed generation with unexpected error" : "is misconfigured for generation")} :: {controller.Error.Replace('\r', ' ').Replace('\n', ' ')}";
- }
- else
- {
- return null;
- }
- }
-
-
-
- public static string WriteVersionBlocks(GenerationContext context)
- {
- var versions = context.HubClients.Where(x => x.Generated)
- .GroupBy(x => x.NamespaceVersion)
- .OrderBy(x => x.Key)
- .ToList();
-
- if (!versions.Any())
- {
- return string.Empty;
- }
-
- return
-$@"
-
-{string.Join(Environment.NewLine, versions.Select(WriteVersionGroup))}
-
-";
-
- }
-
- public static string WriteVersionGroup(IGrouping version)
- {
- return
-$@"
-namespace { Settings.HubNamespace }{(version.Key != null ? "." : "")}{version.Key}
-{{
-{string.Join(Environment.NewLine, version.OrderBy(x => x.Name).Select(WriteHub))}
-}}
-";
- }
-
-
-
- public static string WriteHub(HubController controller)
- {
- return
-$@"
-{(controller.NamespaceSuffix != null ? $@"namespace {controller.NamespaceSuffix}
-{{" : string.Empty)}
-
- {WriteConnectionBuilder(controller)}
-
- {WriteConnection(controller)}
-
-{(controller.NamespaceSuffix != null ? $@"}}" : string.Empty)}
-";
- }
-
- private static string WriteConnectionBuilder(HubController controller)
- {
- return
-$@"
-{SharedWriter.GetObsolete(controller)}
-public class {controller.Name}HubConnectionBuilder : HubConnectionBuilder
-{{
- private bool _hubConnectionBuilt;
-
- public {controller.Name}HubConnectionBuilder(Uri host, HttpTransportType? transports = null, Action configureHttpConnection = null) : base()
- {{
- //Remove default HubConnection to use custom one
- Services.Remove(Services.Where(x => x.ServiceType == typeof(HubConnection)).Single());
- Services.AddSingleton<{controller.Name}HubConnection>();
-
- Services.Configure