Ejemplo n.º 1
0
        // Kommando Behandlung: Validierung und Event Persistierung
        private void SpecifyToDo(SpecifyToDo specifyToDo)
        {
            Context.System.Log.Debug("Actor {0}: received command {1}",
                                     Self.Path.Name, specifyToDo
                                     );

            Persist(new ToDoSpecified(specifyToDo.Id, specifyToDo.Description));
        }
Ejemplo n.º 2
0
        private void SpecifyToDo(SpecifyToDo specifyToDo)
        {
            Context.System.Log.Debug("Actor {0}: process {1}", Self.Path.Name, specifyToDo);

            var id = specifyToDo.Id;

            EnsureToDoExists(id); // legt fehlenden Aktor an

            Context.Child(id).Forward(specifyToDo);
        }
Ejemplo n.º 3
0
        // wir erhalten eine Information über ein neues oder geändertes ToDo
        private void ToDoSpecified(SpecifyToDo toDoSpecified)
        {
            Context.System.Log.Debug("Actor {0}: process {1}", Self.Path.Name, toDoSpecified);

            var todo = new ToDoDocument(toDoSpecified.Id, toDoSpecified.Description);

            var position = toDos.FindIndex(x => x.Id == todo.Id);

            if (position != -1)
            {
                toDos[position] = todo;
            }
            else
            {
                toDos.Add(todo);
            }

            Context.System.Log.Debug("Actor {0}: TODOs: {1}",
                                     Self.Path.Name,
                                     String.Join(", ", toDos.Select(t => t.Id))
                                     );
        }