Skip to content

Commit

Permalink
TypeUnions init
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiago Almeida committed Jul 19, 2023
1 parent cf98f88 commit 984b4d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions samples/SampleModels/Models/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ public class Person
public List<List<string>> Strings { get; set; }
public string[][] Strings2 { get; set; }
public AccessLevel AccessLevel { get; set; }

[TypeUnion("type1", "type2")]
public string TypeUnions { get; set; }
}
}
10 changes: 10 additions & 0 deletions samples/SampleModels/Models/TypeUnions.cs
Original file line number Diff line number Diff line change
@@ -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) { }
}
}

0 comments on commit 984b4d2

Please sign in to comment.