/// <summary>
        /// Deserialize the BrokeredMessage message body into a MetadataMessage
        /// </summary>
        /// <param name="message">BrokeredMessage message body</param>
        /// <param name="brokeredMessage">BrokeredMessage message</param>
        /// <returns>ICrmSubscriptionMessage</returns>
        internal static ICrmSubscriptionMessage DeserializeMessage(string message, BrokeredMessage brokeredMessage)
        {
            MetadataMessage metadataMessage = (MetadataMessage)CrmSubscriptionMessage.DeserializeMessage(message, typeof(MetadataMessage));

            if (metadataMessage != null && metadataMessage.ValidMessage)
            {
                metadataMessage.AppendProperties(brokeredMessage);
                return(metadataMessage);
            }

            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Deserialize the BrokeredMessage message body into a EntityRecordMessage
        /// </summary>
        /// <param name="message">BrokeredMessage message body</param>
        /// <param name="brokeredMessage">BrokeredMessage message</param>
        /// <returns>ICrmSubscriptionMessage</returns>
        internal static ICrmSubscriptionMessage DeserializeMessage(string message, BrokeredMessage brokeredMessage)
        {
            EntityRecordMessage entityRecordMessage = (EntityRecordMessage)CrmSubscriptionMessage.DeserializeMessage(message, typeof(EntityRecordMessage));

            if (entityRecordMessage != null && entityRecordMessage.ValidMessage)
            {
                entityRecordMessage.AppendProperties(brokeredMessage);
                return(entityRecordMessage);
            }

            return(null);
        }