diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..efbf566b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "CodeGen"]
+ path = CodeGen
+ url = https://github.com/Synergex/CodeGen.git
+ branch = hcnet6
diff --git a/Application1/Application1.synproj b/Application1/Application1.synproj
new file mode 100644
index 00000000..04a5fc3d
--- /dev/null
+++ b/Application1/Application1.synproj
@@ -0,0 +1,60 @@
+
+
+
+ Debug
+ x86
+ Application1
+ <Synergy Main>
+ Application1
+ {5fae2bb6-ba77-4204-a910-4ef4d801d7e0}
+ {7B8CF543-378A-4EC1-BB1B-98E4DC6E6820};{BBD0F5D1-1CC4-42fd-BA4C-A96779C64378}
+ application
+ True
+ True
+ True
+ $(SolutionDir)Common.props
+ Application1
+
+
+ true
+ $(SolutionDir)\$(Configuration)\$(Platform)
+ EXEDIR:
+ x86
+ false
+ Debug
+
+
+ true
+ $(SolutionDir)\$(Configuration)\$(Platform)
+ EXEDIR:
+ x64
+ false
+ Debug
+
+
+ true
+ $(SolutionDir)\$(Configuration)\$(Platform)
+ EXEDIR:
+ x86
+ false
+ Optimize
+
+
+ true
+ $(SolutionDir)\$(Configuration)\$(Platform)
+ EXEDIR:
+ x64
+ false
+ Optimize
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CodeGen b/CodeGen
new file mode 160000
index 00000000..aa33d6d9
--- /dev/null
+++ b/CodeGen
@@ -0,0 +1 @@
+Subproject commit aa33d6d9600ab9bf0038d4d6678873a51776d5e0
diff --git a/DataGenerator/DataGenerator.synproj b/DataGenerator/DataGenerator.synproj
index 5d34f53e..bf6c6f62 100644
--- a/DataGenerator/DataGenerator.synproj
+++ b/DataGenerator/DataGenerator.synproj
@@ -2,7 +2,7 @@
Exe
- netcoreapp3.1
+ net5.0
.dbl
false
DataGenerator
diff --git a/Generators/Enabled/ODataGenerator.csx b/Generators/Enabled/ODataGenerator.csx
new file mode 100644
index 00000000..45da5a8d
--- /dev/null
+++ b/Generators/Enabled/ODataGenerator.csx
@@ -0,0 +1,22 @@
+
+public class CustomODataGenerator : ODataGenerator
+{
+ public override void ApplyDefaults(Solution solution)
+ {
+
+ }
+
+ public override List ValidateSolution(Solution solution)
+ {
+ return new List();
+ }
+
+ public override List GenerateTasks(Solution solution)
+ {
+ var baseTasks = base.GenerateTasks(solution);
+ baseTasks.Add(StructureTaskHelper(solution, "Generate controller properties partial classes", solution.ControllersNamespace, solution.ControllersFolder, false, nameof(ODataGenerator), new string[] { "ODataControllerPropertyEndpoints" }, null));
+ return baseTasks;
+ }
+}
+
+new CustomODataGenerator()
\ No newline at end of file
diff --git a/Harmony.AspNetCore/Context/IMultiTenantMiddleware.dbl b/Harmony.AspNetCore/Context/IMultiTenantMiddleware.dbl
index 373fb670..1e67adaf 100644
--- a/Harmony.AspNetCore/Context/IMultiTenantMiddleware.dbl
+++ b/Harmony.AspNetCore/Context/IMultiTenantMiddleware.dbl
@@ -30,8 +30,15 @@ namespace Harmony.AspNetCore.Context
public static extension method UseMultiTenancy, @IApplicationBuilder
builder, @IApplicationBuilder
identifier, @Func
- proc
- builder.Use(lambda(context, next) { InvokeMiddleware(identifier, context, next) })
+ proc
+ lambda implementation(context, next)
+ begin
+ mreturn InvokeMiddleware(identifier, context, next)
+ end
+
+ data implementationInstance, @Func, Task>, implementation
+
+ builder.Use(implementationInstance)
mreturn builder
endmethod
endclass
diff --git a/Harmony.AspNetCore/Harmony.AspNetCore.synproj b/Harmony.AspNetCore/Harmony.AspNetCore.synproj
index 2587b414..ca24e197 100644
--- a/Harmony.AspNetCore/Harmony.AspNetCore.synproj
+++ b/Harmony.AspNetCore/Harmony.AspNetCore.synproj
@@ -1,6 +1,6 @@
- netcoreapp3.1
+ net6.0
.dbl
false
Harmony.AspNetCore
@@ -39,9 +39,15 @@
-
-
-
+
+ 22.8.1287
+
+
+ 12.1.1.3278
+
+
+ 5.0.0
+
diff --git a/Harmony.Core.AspNetCore.nuspec b/Harmony.Core.AspNetCore.nuspec
index 5827b0fb..83ecb5e5 100644
--- a/Harmony.Core.AspNetCore.nuspec
+++ b/Harmony.Core.AspNetCore.nuspec
@@ -14,8 +14,8 @@
-
-
+
+
diff --git a/Harmony.Core.CodeGen.json b/Harmony.Core.CodeGen.json
new file mode 100644
index 00000000..26a6e5de
--- /dev/null
+++ b/Harmony.Core.CodeGen.json
@@ -0,0 +1,236 @@
+{
+ "CreatedWithToolVersion": "1.0",
+ "WrittenWithToolVersion": "1.0",
+ "RPSMFIL": "HarmonyCore.Test.Repository\\bin\\Debug\\rpsmain.ism",
+ "RPSTFIL": "HarmonyCore.Test.Repository\\bin\\Debug\\rpstext.ism",
+ "RepositoryProject": "HarmonyCore.Test.Repository\\HarmonyCore.Test.Repository.synproj",
+ "EnableNewtonsoftJson": true,
+ "TraditionalBridge": {
+ "XFServerSMCPath": "XfplEnvironment\\smc.xml"
+ },
+ "ServicesNamespace": "Services",
+ "ControllersNamespace": "Services.Controllers",
+ "ModelsNamespace": "Services.Models",
+ "ClientModelsNamespace": "Services.Test.Models",
+ "UnitTestsNamespace": "Services.Test.UnitTests",
+ "UnitTestsBaseNamespace": "Services.Test",
+ "SelfHostNamespace": "Services.Host",
+ "TraditionalBridgeNamespace": "TraditionalBridge",
+ "DataFolder": "SampleData",
+ "APIDocsPath": "api-docs",
+ "APITitle": "Harmony Core Sample API",
+ "APIVersion": "1",
+ "APIDescription": "This environment presents an example of using Harmony Core to expose a collection of RESTful Web Service endpoints that allow you to interact with a small sample dataset.",
+ "APITerms": "Open Source",
+ "APIContactName": "Jodah Veloper",
+ "APIContactEmail": "jodah.veloper@synergexpsg.com",
+ "APILicenseName": "BSD-2-Clause",
+ "APILicenseUrl": "https://opensource.org/licenses/BSD-2-Clause",
+ "APIEnableQueryParams": "(MaxExpansionDepth=4)",
+ "ServerName": "localhost",
+ "ServerHttpPort": "8085",
+ "ServerHttpsPort": "8086",
+ "ServerBasePath": "odata",
+ "OAuthServer": "http://localhost:5000",
+ "OAuthApi": "api1",
+ "OAuthClient": "ro.client",
+ "OAuthSecret": "CBF7EBE6-D46E-41A7-903B-766A280616C3",
+ "OAuthTestUser": "jodah",
+ "OAuthTestPassword": "P@ssw0rd",
+ "CustomAuthController": "Authentication",
+ "CustomAuthEndpointPath": "GetToken",
+ "CustomAuthUserName": "username",
+ "CustomAuthPassword": "password",
+ "SignalRPath": "/hub/radley",
+ "TemplatesFolder": "Templates",
+ "ServicesFolder": "Services",
+ "ControllersFolder": "Services.Controllers",
+ "ModelsFolder": "Services.Models",
+ "SelfHostFolder": "Services.Host",
+ "UnitTestFolder": "Services.Test",
+ "IsolatedFolder": "Isolated",
+ "TraditionalBridgeFolder": "TraditionalBridge",
+ "ServicesProject": "Services",
+ "ControllersProject": "Services.Controllers",
+ "ModelsProject": "Services.Models",
+ "SelfHostProject": "Services.Host",
+ "UnitTestProject": "Services.Test",
+ "IsolatedProject": "Isolated",
+ "TraditionalBridgeProject": "TraditionalBridge",
+ "FullCollectionEndpoints": true,
+ "PrimaryKeyEndpoints": true,
+ "AlternateKeyEndpoints": true,
+ "CollectionCountEndpoints": true,
+ "PutEndpoints": true,
+ "PostEndpoints": true,
+ "PatchEndpoints": true,
+ "DeleteEndpoints": true,
+ "ODataSelect": true,
+ "ODataFilter": true,
+ "ODataOrderBy": true,
+ "ODataTop": true,
+ "ODataSkip": true,
+ "ODataRelations": true,
+ "ODataRelationValidation": true,
+ "GenerateSelfHost": true,
+ "CreateTestFiles": true,
+ "GeneratePostmanTests": true,
+ "GenerateUnitTests": true,
+ "GenerateOData": true,
+ "AdapterRouting": true,
+ "StoredProcedureRouting": true,
+ "FieldOverlays": true,
+ "ExtendedStructures": [
+ {
+ "Name": "CUSTOMERS",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ],
+ "RelationsSpecs": [
+ {
+ "FromStructure": "CUSTOMERS",
+ "FromKey": "CUSTOMER_NUMBER",
+ "ToStructure": "ORDERS",
+ "ToKey": "CUSTOMER_NUMBER",
+ "RelationName": "CustomerOrders",
+ "RequiresMatch": false,
+ "ValidationMode": "None",
+ "BackRelation": "ORDERS-CUSTOMERS-CUSTOMER_NUMBER-CUSTOMER_NUMBER",
+ "RelationType": "D",
+ "CustomValidatorName": ""
+ },
+ {
+ "FromStructure": "CUSTOMERS",
+ "FromKey": "FAVORITE_ITEM",
+ "ToStructure": "ITEMS",
+ "ToKey": "ITEM_NUMBER",
+ "RelationName": "CustomerFavoriteItem",
+ "RequiresMatch": false,
+ "ValidationMode": "ValuePresent",
+ "BackRelation": "ITEMS-CUSTOMERS-ITEM_NUMBER-FAVORITE_ITEM",
+ "RelationType": "C",
+ "CustomValidatorName": ""
+ },
+ {
+ "FromStructure": "CUSTOMERS",
+ "FromKey": "CUSTOMER_NUMBER",
+ "ToStructure": "CUSTOMER_NOTES",
+ "ToKey": "CUSTOMER_NUMBER",
+ "RelationName": "CustomerNotes",
+ "RequiresMatch": false,
+ "ValidationMode": "None",
+ "BackRelation": "CUSTOMER_NOTES-CUSTOMERS-CUSTOMER_NUMBER-CUSTOMER_NUMBER",
+ "RelationType": "D",
+ "CustomValidatorName": ""
+ }
+ ]
+ },
+ {
+ "Name": "CUSTOMER_NOTES",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "ITEMS",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "ORDERS",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "ORDER_ITEMS",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "VENDORS",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "CUSTOMER_EX",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "NONUNIQUEPK",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "DIFFERENTPK",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "TESTCAR",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "TESTCARLOT",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "TESTCAROWNER1",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "TESTCAROWNER2",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ },
+ {
+ "Name": "TESTCAROWNER3",
+ "EnabledGenerators": [
+ "ModelGenerator",
+ "ODataGenerator",
+ "EFCoreGenerator"
+ ]
+ }
+ ],
+ "ExtendedInterfaces": []
+}
\ No newline at end of file
diff --git a/Harmony.Core.EF.nuspec b/Harmony.Core.EF.nuspec
index 1d4e55f9..67a6abe5 100644
--- a/Harmony.Core.EF.nuspec
+++ b/Harmony.Core.EF.nuspec
@@ -11,13 +11,13 @@
-
-
+
+
-
-
+
+
diff --git a/Harmony.Core.OData.nuspec b/Harmony.Core.OData.nuspec
index 71c12293..28ab0273 100644
--- a/Harmony.Core.OData.nuspec
+++ b/Harmony.Core.OData.nuspec
@@ -11,16 +11,16 @@
-
-
-
-
-
+
+
+
+
+
-
-
+
+
diff --git a/Harmony.Core.nuspec b/Harmony.Core.nuspec
index 2531c5f3..ded7de01 100644
--- a/Harmony.Core.nuspec
+++ b/Harmony.Core.nuspec
@@ -9,27 +9,23 @@
HarmonyCore package that provides base runtime functionality
https://www.github.com/Synergex/HarmonyCore
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
diff --git a/Harmony.OData/Adapter/AdapterRoutingApplicationModelProvider.dbl b/Harmony.OData/Adapter/AdapterRoutingApplicationModelProvider.dbl
new file mode 100644
index 00000000..63665a42
--- /dev/null
+++ b/Harmony.OData/Adapter/AdapterRoutingApplicationModelProvider.dbl
@@ -0,0 +1,56 @@
+import System
+import System.Collections.Generic
+import System.Text
+import Microsoft.AspNetCore.Mvc.ApplicationModels
+import Microsoft.AspNetCore.OData
+
+
+namespace Harmony.OData.Adapter
+
+ public class AdapterRoutingApplicationModelProvider implements IApplicationModelProvider
+
+ private readwrite property _options, @ODataOptions
+
+ public method AdapterRoutingApplicationModelProvider
+ opts, @ODataOptions
+ endparams
+ proc
+ _options = opts
+ endmethod
+
+
+ public virtual property Order, int
+ method get
+ proc
+ mreturn 101
+ endmethod
+ endproperty
+
+
+
+ public virtual method OnProvidersExecuted, void
+ context, @ApplicationModelProviderContext
+ endparams
+ proc
+ nop
+ endmethod
+
+
+
+ public virtual method OnProvidersExecuting, void
+ context, @ApplicationModelProviderContext
+ endparams
+ proc
+ mreturn
+ endmethod
+
+
+
+
+
+
+
+
+ endclass
+
+endnamespace
diff --git a/Harmony.OData/Adapter/AdapterRoutingAttributes.dbl b/Harmony.OData/Adapter/AdapterRoutingAttributes.dbl
index fcae921c..7adaf075 100644
--- a/Harmony.OData/Adapter/AdapterRoutingAttributes.dbl
+++ b/Harmony.OData/Adapter/AdapterRoutingAttributes.dbl
@@ -8,10 +8,10 @@ import System.Linq.Expressions
import System.ComponentModel
import System.Reflection
import System.Linq
-import Microsoft.AspNet.OData.Query
-import Microsoft.AspNet.OData.Extensions
+import Microsoft.AspNetCore.OData.Query
+import Microsoft.AspNetCore.OData.Extensions
import Microsoft.OData.Edm
-import Microsoft.AspNet.OData
+import Microsoft.AspNetCore.OData
import Harmony.Core.Utility
import Newtonsoft.Json
import System.Collections.Concurrent
@@ -88,11 +88,11 @@ namespace Harmony.OData.Adapter
context, @ActionExecutingContext
proc
data feature = context.HttpContext.ODataFeature()
- data odataPath = feature.Path
- data svc = feature.RequestContainer.GetService(^typeof(IEdmModel))
+ data odPath = feature.Path
+ data svc = feature.Services.GetService(^typeof(IEdmModel)) ?? feature.Model
data model = ^as(svc, @IEdmModel)
- data elementType = odataPath.EdmType .is. IEdmCollectionType ? ((@IEdmCollectionType)odataPath.EdmType).ElementType.Definition : odataPath.EdmType
- data odataQuery = new ODataQueryOptions(new ODataQueryContext(model, elementType, odataPath), context.HttpContext.Request)
+ data elementType = odPath.FirstSegment.EdmType .is. IEdmCollectionType ? ((@IEdmCollectionType)odPath.FirstSegment.EdmType).ElementType.Definition : odPath.FirstSegment.EdmType
+ data odataQuery = new ODataQueryOptions(new ODataQueryContext(model, elementType, odPath), context.HttpContext.Request)
data filterClause = odataQuery.Filter?.FilterClause
data filterLookup = new Dictionary>()
DebugLogSession.Logging.LogTrace("AdapterActionInvoker: processing expression tree {0}, with lookup {1}", new UriExpressionLogHelper(filterClause?.Expression), new JsonLogHelper(filterLookup))
@@ -222,7 +222,7 @@ namespace Harmony.OData.Adapter
odataOptions, @ODataQueryOptions
proc
data result = new Dictionary