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; }
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) }); }