瀏覽代碼

Zebus.Contracts

Lucas Trzesniewski 7 年之前
父節點
當前提交
be557da505

+ 2 - 2
build/Abc.Zebus.Testing.nuspec

@@ -22,8 +22,8 @@
     </dependencies>
   </metadata>
   <files>
-    <file src="Abc.Zebus.Testing.pdb" target="lib\net46\" />
-    <file src="Abc.Zebus.Testing.dll" target="lib\net46\" />
+    <file src="Abc.Zebus.Testing.pdb" target="lib\net461\" />
+    <file src="Abc.Zebus.Testing.dll" target="lib\net461\" />
 
     <file src=".\..\..\src\Abc.Zebus.Testing\**\*.cs" target="src" />
   </files>

+ 3 - 3
build/Abc.Zebus.nuspec

@@ -22,9 +22,9 @@
     </dependencies>
   </metadata>
   <files>
-    <file src="Abc.Zebus.dll" target="lib\net46\" />
-    <file src="Abc.Zebus.pdb" target="lib\net46\" />
-    <file src=".\..\..\lib\zmq\ZeroMQ.dll" target="lib\net46\" />
+    <file src="Abc.Zebus.dll" target="lib\net461\" />
+    <file src="Abc.Zebus.pdb" target="lib\net461\" />
+    <file src=".\..\..\lib\zmq\ZeroMQ.dll" target="lib\net461\" />
     <file src=".\..\..\src\Abc.Zebus\**\*.cs" target="src" />
   </files>
 </package>

+ 8 - 0
src/Abc.Zebus.Contracts/Abc.Zebus.Contracts.csproj

@@ -0,0 +1,8 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <RootNamespace>Abc.Zebus</RootNamespace>
+  </PropertyGroup>
+
+</Project>

+ 3 - 3
src/Abc.Zebus/EventSourcing/AggregateRootIdAttribute.cs → src/Abc.Zebus.Contracts/EventSourcing/AggregateRootIdAttribute.cs

@@ -2,8 +2,8 @@
 
 namespace Abc.Zebus.EventSourcing
 {
-    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
-    public class AggregateRootIdAttribute : Attribute
+    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
+    public sealed class AggregateRootIdAttribute : Attribute
     {
     }
-}
+}

+ 15 - 0
src/Abc.Zebus.Contracts/EventSourcing/SerializationIdAttribute.cs

@@ -0,0 +1,15 @@
+using System;
+
+namespace Abc.Zebus.EventSourcing
+{
+    [AttributeUsage(AttributeTargets.Class, Inherited = false)]
+    public sealed class SerializationIdAttribute : Attribute
+    {
+        public string FullName { get; }
+
+        public SerializationIdAttribute(string fullName)
+        {
+            FullName = fullName;
+        }
+    }
+}

+ 1 - 2
src/Abc.Zebus/ICommand.cs → src/Abc.Zebus.Contracts/ICommand.cs

@@ -2,6 +2,5 @@ namespace Abc.Zebus
 {
     public interface ICommand : IMessage
     {
-       
     }
-}
+}

+ 1 - 2
src/Abc.Zebus/IEvent.cs → src/Abc.Zebus.Contracts/IEvent.cs

@@ -2,6 +2,5 @@ namespace Abc.Zebus
 {
     public interface IEvent : IMessage
     {
-        
     }
-}
+}

+ 1 - 2
src/Abc.Zebus/IMessage.cs → src/Abc.Zebus.Contracts/IMessage.cs

@@ -2,6 +2,5 @@ namespace Abc.Zebus
 {
     public interface IMessage
     {
-        
     }
-}
+}

+ 1 - 1
src/Abc.Zebus/MessageTypeIdAttribute.cs → src/Abc.Zebus.Contracts/MessageTypeIdAttribute.cs

@@ -5,7 +5,7 @@ namespace Abc.Zebus
     [AttributeUsage(AttributeTargets.Class)]
     public sealed class MessageTypeIdAttribute : Attribute
     {
-        public Guid MessageTypeId { get; private set; }
+        public Guid MessageTypeId { get; }
 
         public MessageTypeIdAttribute(string typeId)
         {

+ 9 - 0
src/Abc.Zebus.Contracts/Routing/Routable.cs

@@ -0,0 +1,9 @@
+using System;
+
+namespace Abc.Zebus.Routing
+{
+    [AttributeUsage(AttributeTargets.Class)]
+    public sealed class Routable : Attribute
+    {
+    }
+}

+ 4 - 4
src/Abc.Zebus/Routing/RoutingPositionAttribute.cs → src/Abc.Zebus.Contracts/Routing/RoutingPositionAttribute.cs

@@ -2,14 +2,14 @@
 
 namespace Abc.Zebus.Routing
 {
-    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
-    public class RoutingPositionAttribute : Attribute
+    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
+    public sealed class RoutingPositionAttribute : Attribute
     {
-        public int Position { get; private set; }
+        public int Position { get; }
 
         public RoutingPositionAttribute(int position)
         {
             Position = position;
         }
     }
-}
+}

+ 0 - 0
src/Abc.Zebus/TransientAttribute.cs → src/Abc.Zebus.Contracts/TransientAttribute.cs


+ 1 - 1
src/Abc.Zebus.Testing/Abc.Zebus.Testing.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net46</TargetFramework>
+    <TargetFramework>net461</TargetFramework>
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>

+ 1 - 1
src/Abc.Zebus.Tests.TestExe/Abc.Zebus.Tests.TestExe.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net46</TargetFramework>
+    <TargetFramework>net461</TargetFramework>
     <OutputType>Exe</OutputType>
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
     <ErrorReport>prompt</ErrorReport>

+ 1 - 1
src/Abc.Zebus.Tests/Abc.Zebus.Tests.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net46</TargetFramework>
+    <TargetFramework>net461</TargetFramework>
     <OutputType>Exe</OutputType>
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
     <ErrorReport>prompt</ErrorReport>

+ 6 - 41
src/Abc.Zebus.sln

@@ -22,69 +22,34 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "@ Solution Items", "@ Solut
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Abc.Zebus.Tests.TestExe", "Abc.Zebus.Tests.TestExe\Abc.Zebus.Tests.TestExe.csproj", "{652017D8-EB34-4A79-B14F-DB0477E43915}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Abc.Zebus.Contracts", "Abc.Zebus.Contracts\Abc.Zebus.Contracts.csproj", "{507A4411-DB8A-4663-A491-CCA29854B890}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
-		Debug|Mixed Platforms = Debug|Mixed Platforms
-		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
-		Release|Mixed Platforms = Release|Mixed Platforms
-		Release|x64 = Release|x64
-		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Debug|x86.Build.0 = Debug|Any CPU
 		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Release|Any CPU.Build.0 = Release|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Release|x64.ActiveCfg = Release|Any CPU
-		{1F4C6307-6113-40D5-BF42-4B6BF5DF13B2}.Release|x86.ActiveCfg = Release|Any CPU
 		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Debug|x86.Build.0 = Debug|Any CPU
 		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Release|Any CPU.Build.0 = Release|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Release|x64.ActiveCfg = Release|Any CPU
-		{7BF5AC28-91DB-40EF-8CB7-024E518FA799}.Release|x86.ActiveCfg = Release|Any CPU
 		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Debug|x86.Build.0 = Debug|Any CPU
 		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Release|Any CPU.Build.0 = Release|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Release|x64.ActiveCfg = Release|Any CPU
-		{4CE123DF-8021-411C-929B-53E5C5FC1E04}.Release|x86.ActiveCfg = Release|Any CPU
 		{652017D8-EB34-4A79-B14F-DB0477E43915}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{652017D8-EB34-4A79-B14F-DB0477E43915}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{652017D8-EB34-4A79-B14F-DB0477E43915}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{652017D8-EB34-4A79-B14F-DB0477E43915}.Release|Any CPU.Build.0 = Release|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Release|x64.ActiveCfg = Release|Any CPU
-		{652017D8-EB34-4A79-B14F-DB0477E43915}.Release|x86.ActiveCfg = Release|Any CPU
+		{507A4411-DB8A-4663-A491-CCA29854B890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{507A4411-DB8A-4663-A491-CCA29854B890}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{507A4411-DB8A-4663-A491-CCA29854B890}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{507A4411-DB8A-4663-A491-CCA29854B890}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 5 - 1
src/Abc.Zebus/Abc.Zebus.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net46</TargetFramework>
+    <TargetFramework>net461</TargetFramework>
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
@@ -23,6 +23,10 @@
     <DefineConstants>TRACE</DefineConstants>
   </PropertyGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\Abc.Zebus.Contracts\Abc.Zebus.Contracts.csproj" />
+  </ItemGroup>
+
   <ItemGroup>
     <PackageReference Include="log4net" Version="2.0.8" />
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />

+ 0 - 15
src/Abc.Zebus/EventSourcing/SerializationIdAttribute.cs

@@ -1,15 +0,0 @@
-using System;
-
-namespace Abc.Zebus.EventSourcing
-{
-    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
-    public class SerializationIdAttribute : Attribute
-    {
-        public string FullName { get; private set; }
-
-        public SerializationIdAttribute(string fullName)
-        {
-            FullName = fullName;
-        }
-    }
-}

+ 0 - 9
src/Abc.Zebus/Routing/Routable.cs

@@ -1,9 +0,0 @@
-using System;
-
-namespace Abc.Zebus.Routing
-{
-    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
-    public class Routable : Attribute
-    {
-    }
-}