Esempio n. 1
0
 public TodosService(ITodoEventService events)
 {
     _todos = new List <Todo>();
     _todos.Add(new Todo("1000", "Buy milk", false));
     _todos.Add(new Todo("2000", "Wash car", false));
     _todos.Add(new Todo("3000", "Buy bread", false));
     _todos.Add(new Todo("4000", "Go home", false));
     _events = events;
 }
Esempio n. 2
0
 public TodosSubscription(ITodoEventService events)
 {
     _events = events;
     Name    = "Subscription";
     AddField(new EventStreamFieldType
     {
         Name       = "todoEvent",
         Type       = typeof(TodoEventType),
         Resolver   = new FuncFieldResolver <TodoEvent>(ResolveEvent),
         Subscriber = new EventStreamResolver <TodoEvent>(Subscribe)
     });
 }