Exemple #1
0
        public TargetRelation(TargetRelationType relationType, string @ref)
        {
            if (@ref == null)
            {
                throw new ArgumentNullException(nameof(@ref));
            }

            RelationType = relationType;
            Ref          = @ref;
        }
Exemple #2
0
        internal static TargetRelation DeserializeTargetRelation(JsonElement element)
        {
            TargetRelationType relationType = default;
            string             @ref         = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("relationType"))
                {
                    relationType = property.Value.GetString().ToTargetRelationType();
                    continue;
                }
                if (property.NameEquals("ref"))
                {
                    @ref = property.Value.GetString();
                    continue;
                }
            }
            return(new TargetRelation(relationType, @ref));
        }
Exemple #3
0
 public static string ToSerialString(this TargetRelationType value) => value switch
 {