Ejemplo n.º 1
0
 public Command(EventGridEvent egCommandNotification)
 {
     if (null != egCommandNotification)
     {
         // get the NewEventEventGridPayload from the event grid event
         NewEventEventGridPayload payload = egCommandNotification.Data as NewEventEventGridPayload;
         if (null != payload)
         {
             _domainName       = payload.DomainName;
             _commandName      = payload.EntityTypeName;
             _uniqueIdentifier = payload.InstanceKey;
         }
     }
 }
        /// <summary>
        /// Create a new command instance from an event grid notification
        /// </summary>
        /// <param name="egCommandNotification">
        /// The notification that triggered the creation of this command instance
        /// </param>
        public Command(EventGridEvent egCommandNotification)
        {
            if (null != egCommandNotification)
            {
                // get the NewEventEventGridPayload from the event grid event
                NewEventEventGridPayload payload = egCommandNotification.Data.ToObjectFromJson <NewEventEventGridPayload>();
                if (null != payload)
                {
                    _domainName       = payload.DomainName;
                    _commandName      = payload.EntityTypeName;
                    _uniqueIdentifier = payload.InstanceKey;
                }

                StartListener();
            }
        }