Ejemplo n.º 1
0
        public Radio(IEventStream stream, IEventPublisher publisher, IRadioEngine radioEngine)
        {
            _publisher   = publisher;
            _decision    = new Decision(stream);
            _radioEngine = radioEngine;

            Restore(stream);
        }
Ejemplo n.º 2
0
        public static Radio Create(IEventStream stream, IEventPublisher publisher, IRadioEngine radioEngine, string name, string url)
        {
            var radio = new Radio(stream, publisher, radioEngine)
            {
                Name = name,
                Url  = new Uri(url)
            };

            publisher.Publish(new RadioCreated(radio.Name, radio.Url));

            return(radio);
        }