diff --git a/HarmonyCoreCodeGen.Core/Generator/SignalRGenerator.dbl b/HarmonyCoreCodeGen.Core/Generator/SignalRGenerator.dbl index ad4eed8d..cd334ded 100644 --- a/HarmonyCoreCodeGen.Core/Generator/SignalRGenerator.dbl +++ b/HarmonyCoreCodeGen.Core/Generator/SignalRGenerator.dbl @@ -33,7 +33,7 @@ namespace HarmonyCoreGenerator.Generator foreach iface in GeneratorBase.GetTargetInterfaces(^nameof(SignalRGenerator), targetSolution) begin result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate a SignalR hub for the Interface", targetSolution.ControllersNamespace, targetSolution.ControllersFolder, iface, ^nameof(SignalRGenerator), - & new string[#] { "SignalRHub" }, new UserToken[#] { new UserToken("MODELS_NAMESPACE", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Models")) }, Path.Combine(targetSolution.TemplatesFolder,"SignalR"))) + & new string[#] { "SignalRHub" }, new UserToken[#] { new UserToken("MODELS_NAMESPACE", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Models")), new UserToken("DTOS_NAMESPACE", iface.Name) }, Path.Combine(targetSolution.TemplatesFolder,"SignalR"))) end mreturn result diff --git a/HarmonyCoreCodeGen.Core/Generator/TraditionalBridgeGenerator.dbl b/HarmonyCoreCodeGen.Core/Generator/TraditionalBridgeGenerator.dbl index cc43ff44..9a6926d4 100644 --- a/HarmonyCoreCodeGen.Core/Generator/TraditionalBridgeGenerator.dbl +++ b/HarmonyCoreCodeGen.Core/Generator/TraditionalBridgeGenerator.dbl @@ -53,25 +53,29 @@ namespace HarmonyCoreGenerator.Generator begin ;; Request and response models for the service class methods (.NET side) result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate request and response models for the service class methods", targetSolution.ModelsNamespace, targetSolution.ModelsFolder, iface, ^nameof(TraditionalBridgeGenerator), - & new string[#] { "MultiInterfaceServiceModels" }, new UserToken[#] { modelsNamespace }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) + & new string[#] { "MultiInterfaceServiceModels" }, new UserToken[#] { modelsNamespace, new UserToken("DTOS_NAMESPACE", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Models"))}, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) end else begin ;; Request and response models for the service class methods (.NET side) result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate request and response models for the service class methods", targetSolution.ModelsNamespace, targetSolution.ModelsFolder, iface, ^nameof(TraditionalBridgeGenerator), - & new string[#] { "InterfaceServiceModels" }, new UserToken[#] { modelsNamespace }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) + & new string[#] { "InterfaceServiceModels" }, new UserToken[#] { modelsNamespace, new UserToken("DTOS_NAMESPACE", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Models")) }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) end ;; Service class (.NET side) result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate the service class (.NET side)", targetSolution.ControllersNamespace, targetSolution.ControllersFolder, iface, ^nameof(TraditionalBridgeGenerator), - & new string[#] { "InterfaceService" }, new UserToken[#] { modelsNamespace }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) + & new string[#] { "InterfaceService" }, new UserToken[#] { modelsNamespace, new UserToken("DTOS_NAMESPACE", String.Format("{0}.{1}", targetSolution.TraditionalBridgeFolder, iface.Name)) }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) ;; Parameter model classes (Traditional Side) result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate data models for structure parameters", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Models"), Path.Combine(targetSolution.TraditionalBridgeFolder,"Models"), iface, ^nameof(TraditionalBridgeGenerator), & new string[#] { "TraditionalModel", "TraditionalMetadata" }, new UserToken[#] { modelsNamespace }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) - result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate model and metadata classes", targetSolution.ModelsNamespace, targetSolution.ModelsFolder, iface, ^nameof(ModelGenerator), new string[#] { "ODataModel", "ODataMetaData" }, ^null, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) + result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate model and metadata classes", targetSolution.ModelsNamespace, targetSolution.ModelsFolder, iface, ^nameof(TraditionalBridgeGenerator), new string[#] { "ODataModel", "ODataMetaData" }, ^null, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) + ;; Add InterfaceDispatcherData + data interfaceDispatcherDataTask = StructureTaskHelper(targetSolution, "Generate InterfaceDispatcherData", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Dispatchers"), Path.Combine(targetSolution.TraditionalBridgeFolder,"Dispatchers"), true, ^nameof(TraditionalBridgeGenerator), new string[#] { "InterfaceDispatcherData" }, new UserToken[#] { new UserToken("SMC_INTERFACE", iface.Name), new UserToken("DTOS_NAMESPACE", iface.Name) }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge")) + interfaceDispatcherDataTask.Interface = iface.Name + result.Add(interfaceDispatcherDataTask) end mreturn result endmethod diff --git a/HarmonyCoreCodeGen.Core/Generator/WebApiGenerator.dbl b/HarmonyCoreCodeGen.Core/Generator/WebApiGenerator.dbl index 23fbb8bd..0ae23374 100644 --- a/HarmonyCoreCodeGen.Core/Generator/WebApiGenerator.dbl +++ b/HarmonyCoreCodeGen.Core/Generator/WebApiGenerator.dbl @@ -35,7 +35,7 @@ namespace HarmonyCoreGenerator.Generator ;; Web API controller (.NET side) data modelsNamespace = new UserToken("MODELS_NAMESPACE", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Models")) result.Add(GeneratorBase.InterfaceTaskHelper(targetSolution, "Generate Web API controller (.NET side)", String.Format("{0}.{1}",targetSolution.TraditionalBridgeFolder,"Models"), Path.Combine(targetSolution.TraditionalBridgeFolder,"Models"), iface, ^nameof(WebApiGenerator), - & new string[#] { "InterfaceController" }, new UserToken[#] { modelsNamespace }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) + & new string[#] { "InterfaceController" }, new UserToken[#] { modelsNamespace, new UserToken("DTOS_NAMESPACE", iface.Name) }, Path.Combine(targetSolution.TemplatesFolder,"TraditionalBridge"))) ;; Postman tests for the WebAPI operations