TickTack.Models.RegisterIotDeviceRequest.SerializeJson C# (CSharp) Метод

SerializeJson() публичный Метод

Serialize the object
public SerializeJson ( JToken outputObject ) : JToken
outputObject JToken
Результат JToken
        public virtual JToken SerializeJson(JToken outputObject)
        {
            if (outputObject == null)
            {
                outputObject = new JObject();
            }
            if (this.CurrentDeviceId != null)
            {
                outputObject["currentDeviceId"] = this.CurrentDeviceId;
            }
            JArray sensorIdsSequence = null;
            if (this.SensorIds != null)
            {
                if (this.SensorIds is ILazyCollection<string> == false || ((ILazyCollection<string>)this.SensorIds).IsInitialized)
                {
                    sensorIdsSequence = new JArray();
                    outputObject["sensorIds"] = sensorIdsSequence;
                    foreach (string sensorIdsItem in this.SensorIds)
                    {
                        if (sensorIdsItem != null)
                        {
                            sensorIdsSequence.Add(sensorIdsItem);
                        }
                    }
                }
            }
            return outputObject;
        }