2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00

ClassId Attribute

This commit is contained in:
2022-09-03 22:00:26 +03:00
parent 2cf0d59e6b
commit 620dbaf653
8 changed files with 45 additions and 21 deletions

View File

@ -74,6 +74,8 @@ public static class TemplateGenerator
if (template.Annotation != null)
rt.AppendLine($"[Annotation({ToLiteral(template.Annotation)})]");
rt.AppendLine($"[ClassId(\"{template.ClassId.ToByteArray().ToHex(0, 16, null)}\")]");
rt.AppendLine($"[Public] public class {className} : IRecord {{");
@ -104,6 +106,7 @@ public static class TemplateGenerator
if (template.Annotation != null)
rt.AppendLine($"[Annotation({ToLiteral(template.Annotation)})]");
rt.AppendLine($"[ClassId(\"{template.ClassId.ToByteArray().ToHex(0, 16, null)}\")]");
rt.AppendLine($"[Public] public enum {className} {{");
rt.AppendLine(String.Join(",\r\n", template.Constants.Select(x => $"{x.Name}={x.Value}")));
@ -268,6 +271,9 @@ public static class TemplateGenerator
if (template.Annotation != null)
rt.AppendLine($"[Annotation({ToLiteral(template.Annotation)})]");
rt.AppendLine($"[ClassId(\"{template.ClassId.ToByteArray().ToHex(0, 16, null)}\")]");
// extends
if (template.ParentId == null)
rt.AppendLine($"public class {className} : DistributedResource {{");