public FubuContinuation post_create(Create todo) { var todoToCreate = new Domain.Todo(todo.Name, todo.IsComplete); _toDoService.Create(todoToCreate); return(FubuContinuation.RedirectTo <TodoEndpoint>(endpoint => endpoint.get_list())); }
public Task <Domain.Todo> AddAsync(string title) { var todo = new Domain.Todo { Id = Guid.NewGuid(), IsCompleted = false, Title = title }; _todos.TryAdd(todo.Id, todo); return(Task.FromResult(todo)); }
public async Task Foo() { /* Setup */ var readModleComponent = new ListLogicalComponent( _webhostComponent.GetService <IMessageSubscriber>(), _webhostComponent.GetService <IMessagePublisher>() ); await Task.Delay(TimeSpan.FromSeconds(10)); await readModleComponent.StartAsync(); var todo = new Domain.Todo { Id = Guid.NewGuid(), IsCompleted = false, Title = "Run test" }; await _webhostComponent.PublishAsync(new TodoCreated(todo)); await Task.Delay(TimeSpan.FromHours(1)); }
public Task AddOrUpdateAsync(Domain.Todo todo) { _todos.AddOrUpdate(todo.Id, id => todo, (id, existing) => todo); return(Task.CompletedTask); }
public Update(Domain.Todo todo) { Id = todo.Id; Name = todo.Name; IsComplete = todo.IsComplete; }