From 3ce79acb025299c1676b960dbf46b202e87a0694 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 30 Jun 2023 11:09:47 +0800 Subject: [PATCH] update --- .../src/WTA.Shared/Attributes/OneToManyAttribute.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/demo/src/WTA.Shared/Attributes/OneToManyAttribute.cs b/docs/demo/src/WTA.Shared/Attributes/OneToManyAttribute.cs index 5197be21..d78bf874 100644 --- a/docs/demo/src/WTA.Shared/Attributes/OneToManyAttribute.cs +++ b/docs/demo/src/WTA.Shared/Attributes/OneToManyAttribute.cs @@ -1,11 +1,14 @@ namespace WTA.Shared.Attributes; -public class OneToManyAttribute +[AttributeUsage(AttributeTargets.Property)] +public class OneToManyAttribute : Attribute { - public Type Type { get; set; } = null; - public OneToManyAttribute(string property) + public Type Type { get; set; } = null!; + public string? Property { get; } + + public OneToManyAttribute(string? property = null) { - this.Type=typeof(TEntity); - this.Property=Property; + this.Type = typeof(TEntity); + this.Property = property; } }