diff --git a/.build/Common.props b/.build/Common.props index d5b059be3..c50b15d03 100644 --- a/.build/Common.props +++ b/.build/Common.props @@ -1,16 +1,16 @@ - 0.0.0 + 6.0.0 $(MORYX_ASSEMBLY_VERSION) - 0.0.0.0 + 6.0.0.0 $(MORYX_FILE_VERSION) - 0.0.0.0 + 6.0.0.0 $(MORYX_INFORMATIONAL_VERSION) - 0.0.0 + 6.0.0 $(MORYX_PACKAGE_VERSION) PHOENIXCONTACT diff --git a/MORYX-Framework.sln b/MORYX-Framework.sln index a62cf04a1..144390c6e 100644 --- a/MORYX-Framework.sln +++ b/MORYX-Framework.sln @@ -60,6 +60,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DFC092A6-B935-4D19-A564-9AEDEEF999B9}" ProjectSection(SolutionItems) = preProject Build.ps1 = Build.ps1 + .build\Common.props = .build\Common.props Directory.build.props = Directory.build.props Directory.Build.targets = Directory.Build.targets LICENSE = LICENSE @@ -118,9 +119,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Runtime.Endpoints.Tes EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Runtime.Endpoints.IntegrationTests", "src\Tests\Moryx.Runtime.Endpoints.IntegrationTests\Moryx.Runtime.Endpoints.IntegrationTests.csproj", "{4FFB98A7-9A4C-476F-8BCC-C19B7F757BF8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moryx.TestTools.NUnit", "src\Moryx.TestTools.NUnit\Moryx.TestTools.NUnit.csproj", "{6FF878E0-AF61-4C3A-9B9C-71C35A949E51}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.TestTools.NUnit", "src\Moryx.TestTools.NUnit\Moryx.TestTools.NUnit.csproj", "{6FF878E0-AF61-4C3A-9B9C-71C35A949E51}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moryx.TestTools.IntegrationTest", "src\Moryx.TestTools.IntegrationTest\Moryx.TestTools.IntegrationTest.csproj", "{C949164C-0345-4893-9E4C-A79BC1F93F85}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.TestTools.IntegrationTest", "src\Moryx.TestTools.IntegrationTest\Moryx.TestTools.IntegrationTest.csproj", "{C949164C-0345-4893-9E4C-A79BC1F93F85}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -356,8 +357,8 @@ Global {C949164C-0345-4893-9E4C-A79BC1F93F85} = {953AAE25-26C8-4A28-AB08-61BAFE41B22F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - RESX_ShowErrorsInErrorList = True - RESX_TaskErrorCategory = Message SolutionGuid = {36EFC961-F4E7-49DC-A36A-99594FFB8243} + RESX_TaskErrorCategory = Message + RESX_ShowErrorsInErrorList = True EndGlobalSection EndGlobal diff --git a/src/Moryx.AbstractionLayer.Resources.Endpoints/Moryx.AbstractionLayer.Resources.Endpoints.csproj b/src/Moryx.AbstractionLayer.Resources.Endpoints/Moryx.AbstractionLayer.Resources.Endpoints.csproj index 8c981b0b2..d83e545d2 100644 --- a/src/Moryx.AbstractionLayer.Resources.Endpoints/Moryx.AbstractionLayer.Resources.Endpoints.csproj +++ b/src/Moryx.AbstractionLayer.Resources.Endpoints/Moryx.AbstractionLayer.Resources.Endpoints.csproj @@ -6,6 +6,7 @@ REST Api in order to interact with the resource management true MORYX;IIoT;IoT;Resource + true diff --git a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj index 6ce2a84f3..4dcbd846d 100644 --- a/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj +++ b/src/Moryx.AbstractionLayer/Moryx.AbstractionLayer.csproj @@ -6,6 +6,7 @@ Domain model types and definitions of Cyber-physical systems in IIoT projects. true MORYX;IIoT;IoT;Hardware;Communication;Manufacturing;Industrial;Abstraction;Realtime + true diff --git a/src/Moryx.Asp.Extensions/Moryx.Asp.Extensions.csproj b/src/Moryx.Asp.Extensions/Moryx.Asp.Extensions.csproj index ea47f4474..465fb0f26 100644 --- a/src/Moryx.Asp.Extensions/Moryx.Asp.Extensions.csproj +++ b/src/Moryx.Asp.Extensions/Moryx.Asp.Extensions.csproj @@ -5,6 +5,7 @@ Extensions for the Integration of MORYX in ASP.NET Core true MORYX;ASP + true diff --git a/src/Moryx.Container/Moryx.Container.csproj b/src/Moryx.Container/Moryx.Container.csproj index d4aaf59c8..530083d7a 100644 --- a/src/Moryx.Container/Moryx.Container.csproj +++ b/src/Moryx.Container/Moryx.Container.csproj @@ -6,6 +6,7 @@ MORYX container functionality based on Castle.Windsor. true MORYX;Container;IoC + true diff --git a/src/Moryx.Model.InMemory/Moryx.Model.InMemory.csproj b/src/Moryx.Model.InMemory/Moryx.Model.InMemory.csproj index 7331a134a..106450304 100644 --- a/src/Moryx.Model.InMemory/Moryx.Model.InMemory.csproj +++ b/src/Moryx.Model.InMemory/Moryx.Model.InMemory.csproj @@ -6,6 +6,7 @@ InMemory extension for unit tests referencing Moryx.Model true MORYX;Entity;Framework;EntityFramework;DataModel;Model;Database;InMemory;Effort + true diff --git a/src/Moryx.Model.PostgreSQL/Moryx.Model.PostgreSQL.csproj b/src/Moryx.Model.PostgreSQL/Moryx.Model.PostgreSQL.csproj index 19320c878..6bf832f3b 100644 --- a/src/Moryx.Model.PostgreSQL/Moryx.Model.PostgreSQL.csproj +++ b/src/Moryx.Model.PostgreSQL/Moryx.Model.PostgreSQL.csproj @@ -6,6 +6,7 @@ Adapter for Moryx.Model on PostgreSQL true MORYX;Entity;Framework;EntityFramework;DataModel;Model;Database;Npgsql;PostgreSQL;Postgres + true diff --git a/src/Moryx.Model.Sqlite/Moryx.Model.Sqlite.csproj b/src/Moryx.Model.Sqlite/Moryx.Model.Sqlite.csproj index 416751019..32dcb0945 100644 --- a/src/Moryx.Model.Sqlite/Moryx.Model.Sqlite.csproj +++ b/src/Moryx.Model.Sqlite/Moryx.Model.Sqlite.csproj @@ -6,6 +6,7 @@ Adapter for Moryx.Model on Sqlite true MORYX;Entity;Framework;EntityFramework;DataModel;Model;Database;Sqlite + true diff --git a/src/Moryx.Model/Moryx.Model.csproj b/src/Moryx.Model/Moryx.Model.csproj index 9b3e63695..a60ec2853 100644 --- a/src/Moryx.Model/Moryx.Model.csproj +++ b/src/Moryx.Model/Moryx.Model.csproj @@ -6,6 +6,7 @@ Datamodel integration for MORYX applications based on Entity Framework true MORYX;Entity;Framework;EntityFramework;DataModel;Model;Database + true diff --git a/src/Moryx.Notifications/Moryx.Notifications.csproj b/src/Moryx.Notifications/Moryx.Notifications.csproj index 8a7719414..f90151d3b 100644 --- a/src/Moryx.Notifications/Moryx.Notifications.csproj +++ b/src/Moryx.Notifications/Moryx.Notifications.csproj @@ -6,6 +6,7 @@ Types and interfaces for notifications within MORYX applications true MORYX;IIoT;IoT;Notifications + true diff --git a/src/Moryx.Resources.Management/Moryx.Resources.Management.csproj b/src/Moryx.Resources.Management/Moryx.Resources.Management.csproj index fb46a416c..871672ac4 100644 --- a/src/Moryx.Resources.Management/Moryx.Resources.Management.csproj +++ b/src/Moryx.Resources.Management/Moryx.Resources.Management.csproj @@ -7,6 +7,7 @@ ResourceManagement module composing and maintaining the resource graph as the habitat for digital twins of manufacturing assets. true MORYX;IIoT;IoT;Manufacturing;API;Resource + true diff --git a/src/Moryx.Resources.Management/Resources/ResourceTypeController.cs b/src/Moryx.Resources.Management/Resources/ResourceTypeController.cs index 893ef29a1..5140fb217 100644 --- a/src/Moryx.Resources.Management/Resources/ResourceTypeController.cs +++ b/src/Moryx.Resources.Management/Resources/ResourceTypeController.cs @@ -264,17 +264,19 @@ private ResourceProxy InstantiateProxy(string typeName, Resource instance) /// private void ProvideProxyType(Type resourceType) { - // Step 1: Find the least specific base type that offers the same amount of interfaces + // Step 1: Find the least specific base type that offers the same amount of interfaces and is not a generic itself // ReSharper disable once AssignNullToNotNullAttribute -> FullName should be not null var targetType = _typeCache[resourceType.ResourceType()]; var linker = targetType; var interfaces = RelevantInterfaces(linker); - // Move up the type tree until the parent offers less interfaces than the current linker - while (linker.BaseType != null && interfaces.Count == RelevantInterfaces(linker.BaseType).Count) + // Move up the type tree until the parent offers less interfaces than the current linker, is abstract or a generic + while (linker.BaseType != null && !linker.BaseType.ResourceType.IsGenericType + && interfaces.Count == RelevantInterfaces(linker.BaseType).Count) { linker = linker.BaseType; } + // Step 2: Check if we already created a proxy for this type. If we already // did use this one for the requested type as well. diff --git a/src/Moryx.Runtime.Kernel/Moryx.Runtime.Kernel.csproj b/src/Moryx.Runtime.Kernel/Moryx.Runtime.Kernel.csproj index fdc0e91d4..af0f71a82 100644 --- a/src/Moryx.Runtime.Kernel/Moryx.Runtime.Kernel.csproj +++ b/src/Moryx.Runtime.Kernel/Moryx.Runtime.Kernel.csproj @@ -6,6 +6,7 @@ Kernel components that comprise the MORYX server side runtime environment true MORYX;Kernel;Runtime;Server + true diff --git a/src/Moryx.Runtime/Moryx.Runtime.csproj b/src/Moryx.Runtime/Moryx.Runtime.csproj index 80aec6d44..af03381fa 100644 --- a/src/Moryx.Runtime/Moryx.Runtime.csproj +++ b/src/Moryx.Runtime/Moryx.Runtime.csproj @@ -6,6 +6,7 @@ Server side component types and implementations for MORYX applications true MORYX;Runtime;Server + true diff --git a/src/Moryx/Moryx.csproj b/src/Moryx/Moryx.csproj index 76d3188cd..42282fad1 100644 --- a/src/Moryx/Moryx.csproj +++ b/src/Moryx/Moryx.csproj @@ -7,6 +7,7 @@ Core package of the MORYX ecosystem. It defines the necessary types for MORYX compatibility as well as commonly required tools. true MORYX;Serialization;Configuration;Logging;Core;Modules;Workplans + true diff --git a/src/Tests/Moryx.Resources.Management.Tests/Mocks/ResourceWithGenericMethod.cs b/src/Tests/Moryx.Resources.Management.Tests/Mocks/ResourceWithGenericMethod.cs index ee751b561..07ef67d5c 100644 --- a/src/Tests/Moryx.Resources.Management.Tests/Mocks/ResourceWithGenericMethod.cs +++ b/src/Tests/Moryx.Resources.Management.Tests/Mocks/ResourceWithGenericMethod.cs @@ -37,24 +37,18 @@ public class ResourceWithGenericMethod : Resource, IGenericMethodCall, ISimpleRe public event EventHandler SomeEvent; public event EventHandler CapabilitiesChanged; - public IList GenericMethod(string identifier) - { - throw new NotImplementedException(); - } - - public int MultiplyFoo(int factor) - { - throw new NotImplementedException(); - } - - public int MultiplyFoo(int factor, ushort offset) - { - throw new NotImplementedException(); - } - - public void RaiseEvent() - { - throw new NotImplementedException(); - } + public IList GenericMethod(string identifier) => throw new NotImplementedException(); + + public int MultiplyFoo(int factor) => throw new NotImplementedException(); + + public int MultiplyFoo(int factor, ushort offset) => throw new NotImplementedException(); + + public void RaiseEvent() => throw new NotImplementedException(); } + + public interface IGenericBaseResourceInterface : IResource { } + + public class GenericBaseResource : Resource, IGenericBaseResourceInterface { } + + public class InheritingFromGenericResource : GenericBaseResource { } } diff --git a/src/Tests/Moryx.Resources.Management.Tests/TypeControllerTests.cs b/src/Tests/Moryx.Resources.Management.Tests/TypeControllerTests.cs index 8ef3f51f7..ccb8a8f9c 100644 --- a/src/Tests/Moryx.Resources.Management.Tests/TypeControllerTests.cs +++ b/src/Tests/Moryx.Resources.Management.Tests/TypeControllerTests.cs @@ -222,6 +222,20 @@ public void ProxyBuilderFiltersGenericInterfaces() Assert.IsFalse(typeof(IGenericMethodCall).IsAssignableFrom(proxy.GetType())); } + [Test] + public void ProxyBuilderSkipsGenericBaseTypes() + { + // Arrange + var driver = new InheritingFromGenericResource { Id = 42, Name = "A non generic resource inheriting from a generic base type" }; + + // Act + var proxy = _typeController.GetProxy(driver); + + // Assert + Assert.IsNotNull(proxy); + Assert.IsFalse(typeof(GenericBaseResource).IsAssignableFrom(proxy.GetType())); + } + [Test] public void FacadeExceptionForGenericProxy() {