コード例 #1
0
        internal AspectRelation(AspectRelationType relationType, string @ref)
        {
            if (@ref == null)
            {
                throw new ArgumentNullException(nameof(@ref));
            }

            RelationType = relationType;
            Ref          = @ref;
        }
コード例 #2
0
        internal static AspectRelation DeserializeAspectRelation(JsonElement element)
        {
            AspectRelationType relationType = default;
            string             @ref         = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("relationType"))
                {
                    relationType = new AspectRelationType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("ref"))
                {
                    @ref = property.Value.GetString();
                    continue;
                }
            }
            return(new AspectRelation(relationType, @ref));
        }