示例#1
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "fullUrl":
                FullUrl = reader.GetString();
                break;

            case "_fullUrl":
                _FullUrl = new fhirCsR4.Models.Element();
                _FullUrl.DeserializeJson(ref reader, options);
                break;

            case "link":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Link = new List <BundleLink>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.BundleLink objLink = new fhirCsR4.Models.BundleLink();
                    objLink.DeserializeJson(ref reader, options);
                    Link.Add(objLink);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Link.Count == 0)
                {
                    Link = null;
                }

                break;

            case "request":
                Request = new fhirCsR4.Models.BundleEntryRequest();
                Request.DeserializeJson(ref reader, options);
                break;

            case "resource":
                Resource = JsonSerializer.Deserialize <fhirCsR4.Models.Resource>(ref reader, options);
                break;

            case "response":
                Response = new fhirCsR4.Models.BundleEntryResponse();
                Response.DeserializeJson(ref reader, options);
                break;

            case "search":
                Search = new fhirCsR4.Models.BundleEntrySearch();
                Search.DeserializeJson(ref reader, options);
                break;

            default:
                ((fhirCsR4.Models.BackboneElement) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }
示例#2
0
        /// <summary>
        /// Deserialize a JSON property
        /// </summary>
        public new void DeserializeJsonProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName)
        {
            switch (propertyName)
            {
            case "entry":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Entry = new List <BundleEntry>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.BundleEntry objEntry = new fhirCsR4.Models.BundleEntry();
                    objEntry.DeserializeJson(ref reader, options);
                    Entry.Add(objEntry);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Entry.Count == 0)
                {
                    Entry = null;
                }

                break;

            case "identifier":
                Identifier = new fhirCsR4.Models.Identifier();
                Identifier.DeserializeJson(ref reader, options);
                break;

            case "link":
                if ((reader.TokenType != JsonTokenType.StartArray) || (!reader.Read()))
                {
                    throw new JsonException();
                }

                Link = new List <BundleLink>();

                while (reader.TokenType != JsonTokenType.EndArray)
                {
                    fhirCsR4.Models.BundleLink objLink = new fhirCsR4.Models.BundleLink();
                    objLink.DeserializeJson(ref reader, options);
                    Link.Add(objLink);

                    if (!reader.Read())
                    {
                        throw new JsonException();
                    }
                }

                if (Link.Count == 0)
                {
                    Link = null;
                }

                break;

            case "signature":
                Signature = new fhirCsR4.Models.Signature();
                Signature.DeserializeJson(ref reader, options);
                break;

            case "timestamp":
                Timestamp = reader.GetString();
                break;

            case "_timestamp":
                _Timestamp = new fhirCsR4.Models.Element();
                _Timestamp.DeserializeJson(ref reader, options);
                break;

            case "total":
                Total = reader.GetUInt32();
                break;

            case "type":
                Type = reader.GetString();
                break;

            case "_type":
                _Type = new fhirCsR4.Models.Element();
                _Type.DeserializeJson(ref reader, options);
                break;

            default:
                ((fhirCsR4.Models.Resource) this).DeserializeJsonProperty(ref reader, options, propertyName);
                break;
            }
        }