Пример #1
0
        /// <summary>
        /// Map the resource data
        /// </summary>
        /// <param name="data">The Resources Data</param>
        /// <returns>The Resources Data</returns>
        public static ResourcesData Map(mds.Model.ResourcesData data)
        {
            var resourcesData = new ResourcesData
            {
                Path                 = data.Path,
                ResourceType         = data.Rt,
                ContentType          = data.Ct,
                Observable           = data.Obs,
                InterfaceDescription = data._If,
            };

            return(resourcesData);
        }
Пример #2
0
        /// <summary>
        /// Maps to EndpointData
        /// </summary>
        /// <param name="data">Mds Endpoint Data</param>
        /// <param name="state">The device state</param>
        /// <returns>The EndpointData</returns>
        public static DeviceEventData Map(mds.Model.EndpointData data, DeviceEvent state)
        {
            var endpointData = new DeviceEventData
            {
                QueueMode            = data.Q,
                EndpointType         = data.Ept,
                OriginalEndpointType = data.OriginalEp,
                Resources            = data?.Resources?.Select(r => ResourcesData.Map(r))?.ToList(),
                DeviceId             = data.Ep,
                State = state,
            };

            return(endpointData);
        }