From 984b4d2d70d1985c42fc15e16e40d832d73ae341 Mon Sep 17 00:00:00 2001 From: Thiago Almeida Date: Wed, 19 Jul 2023 16:12:41 +0930 Subject: [PATCH] TypeUnions init --- samples/SampleModels/Models/Person.cs | 3 +++ samples/SampleModels/Models/TypeUnions.cs | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 samples/SampleModels/Models/TypeUnions.cs diff --git a/samples/SampleModels/Models/Person.cs b/samples/SampleModels/Models/Person.cs index 1636a0d..ad2b56b 100644 --- a/samples/SampleModels/Models/Person.cs +++ b/samples/SampleModels/Models/Person.cs @@ -27,5 +27,8 @@ public class Person public List> Strings { get; set; } public string[][] Strings2 { get; set; } public AccessLevel AccessLevel { get; set; } + + [TypeUnion("type1", "type2")] + public string TypeUnions { get; set; } } } diff --git a/samples/SampleModels/Models/TypeUnions.cs b/samples/SampleModels/Models/TypeUnions.cs new file mode 100644 index 0000000..708a458 --- /dev/null +++ b/samples/SampleModels/Models/TypeUnions.cs @@ -0,0 +1,10 @@ +using System; +namespace SampleModels.Models +{ + [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + public class TypeUnionAttribute: Attribute + { + public TypeUnionAttribute(params string[] args) { } + public TypeUnionAttribute(params Type[] args) { } + } +}