mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 22:48:42 +00:00
TypeDefGenerator
This commit is contained in:
@@ -6,7 +6,7 @@ using Esiur.Protocol;
|
||||
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Address", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Address", "localhost")]
|
||||
[Export]
|
||||
public class Address : IRecord
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using Google.Protobuf;
|
||||
using System;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Attachment", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Attachment", "localhost")]
|
||||
[Export]
|
||||
public class Attachment : IRecord
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.BusinessDocument", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.BusinessDocument", "localhost")]
|
||||
[Export]
|
||||
public class BusinessDocument : IRecord
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Currency", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Currency", "localhost")]
|
||||
[Export]
|
||||
public enum Currency
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.DocType", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.DocType", "localhost")]
|
||||
[Export]
|
||||
public enum DocType
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using Google.Protobuf;
|
||||
using System;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.DocumentHeader", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.DocumentHeader", "localhost")]
|
||||
[Export]
|
||||
public class DocumentHeader : IRecord
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Kind", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Kind", "localhost")]
|
||||
[Export]
|
||||
public enum Kind
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.LineItem", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.LineItem", "localhost")]
|
||||
[Export]
|
||||
public class LineItem : IRecord
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.LineType", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.LineType", "localhost")]
|
||||
[Export]
|
||||
public enum LineType
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Party", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Party", "localhost")]
|
||||
[Export]
|
||||
public class Party : IRecord
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Payment", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Payment", "localhost")]
|
||||
[Export]
|
||||
public class Payment : IRecord
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Esiur.Data;
|
||||
using Esiur.Protocol;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.PaymentMethod", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.PaymentMethod", "localhost")]
|
||||
[Export]
|
||||
public enum PaymentMethod
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using Esiur.Protocol;
|
||||
#nullable enable
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Service", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Service", "localhost")]
|
||||
public class Service : EpResource
|
||||
{
|
||||
public Service(EpConnection connection, uint instanceId, ulong age, string link) : base(connection, instanceId, age, link) { }
|
||||
|
||||
@@ -6,7 +6,7 @@ using Esiur.Protocol;
|
||||
#nullable enable
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.TestObject", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.TestObject", "localhost")]
|
||||
public class TestObject : EpResource
|
||||
{
|
||||
public TestObject(EpConnection connection, uint instanceId, ulong age, string link) : base(connection, instanceId, age, link) { }
|
||||
|
||||
@@ -6,7 +6,7 @@ using Google.Protobuf;
|
||||
using System;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Variant", "")]
|
||||
[Remote("Esiur.Tests.RPC.EsiurServer.Variant", "localhost")]
|
||||
[Export]
|
||||
public class Variant : IRecord
|
||||
{
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
namespace Esiur {
|
||||
public static class Generated {
|
||||
public static Type[] Resources {get;} = new Type[] { typeof(Esiur.Tests.RPC.EsiurServer.Service),typeof(Esiur.Tests.RPC.EsiurServer.TestObject) };
|
||||
public static Type[] Records { get; } = new Type[] { typeof(Esiur.Tests.RPC.EsiurServer.BusinessDocument),typeof(Esiur.Tests.RPC.EsiurServer.Attachment),typeof(Esiur.Tests.RPC.EsiurServer.Party),typeof(Esiur.Tests.RPC.EsiurServer.Address),typeof(Esiur.Tests.RPC.EsiurServer.DocumentHeader),typeof(Esiur.Tests.RPC.EsiurServer.LineItem),typeof(Esiur.Tests.RPC.EsiurServer.Variant),typeof(Esiur.Tests.RPC.EsiurServer.Payment) };
|
||||
public static Type[] Enums { get; } = new Type[] { typeof(Esiur.Tests.RPC.EsiurServer.Currency),typeof(Esiur.Tests.RPC.EsiurServer.DocType),typeof(Esiur.Tests.RPC.EsiurServer.Kind),typeof(Esiur.Tests.RPC.EsiurServer.LineType),typeof(Esiur.Tests.RPC.EsiurServer.PaymentMethod) };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Esiur.Resource;
|
||||
using System;
|
||||
namespace Esiur.Tests.RPC.EsiurServer
|
||||
{
|
||||
public static class Initialization
|
||||
{
|
||||
public static Type[] Resources { get; } = new Type[] { typeof(Esiur.Tests.RPC.EsiurServer.Service), typeof(Esiur.Tests.RPC.EsiurServer.TestObject) };
|
||||
public static Type[] Records { get; } = new Type[] { typeof(Esiur.Tests.RPC.EsiurServer.BusinessDocument), typeof(Esiur.Tests.RPC.EsiurServer.Attachment), typeof(Esiur.Tests.RPC.EsiurServer.Party), typeof(Esiur.Tests.RPC.EsiurServer.Address), typeof(Esiur.Tests.RPC.EsiurServer.DocumentHeader), typeof(Esiur.Tests.RPC.EsiurServer.LineItem), typeof(Esiur.Tests.RPC.EsiurServer.Variant), typeof(Esiur.Tests.RPC.EsiurServer.Payment) };
|
||||
public static Type[] Enums { get; } = new Type[] { typeof(Esiur.Tests.RPC.EsiurServer.Currency), typeof(Esiur.Tests.RPC.EsiurServer.DocType), typeof(Esiur.Tests.RPC.EsiurServer.Kind), typeof(Esiur.Tests.RPC.EsiurServer.LineType), typeof(Esiur.Tests.RPC.EsiurServer.PaymentMethod) };
|
||||
|
||||
|
||||
public static void RegisterTypes(Warehouse warehouse)
|
||||
{
|
||||
foreach(var type in Resources)
|
||||
warehouse.RegisterProxyType(type);
|
||||
|
||||
foreach(var type in Records)
|
||||
warehouse.RegisterProxyType(type);
|
||||
|
||||
foreach(var type in Enums)
|
||||
warehouse.RegisterProxyType(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user