Beispiel #1
0
        public async Task <IActionResult> Put(int id, InputTodo value)
        {
            if (ModelState.IsValid)
            {
                var result = await _todosService.UpdateForAsync(id, value);

                return(Ok(result));
            }
            return(this.AppBadRequest(ModelState));
        }
Beispiel #2
0
        public async Task <OperationResult> CreateForAsync(InputTodo entityToCreate)
        {
            var mappedTodo = _mapper.Map <Entities.TodoItem>(entityToCreate);
            await _todoContext.Todos.AddAsync(mappedTodo);

            var result = await _todoContext.SaveChangesAsync();

            if (result <= 0)
            {
                return(OperationResult.Failed());
            }
            return(OperationResult.Succeeded());
        }
Beispiel #3
0
 public Task <OperationResult> UpdateForAsync(int key, InputTodo entityToUpdate)
 {
     throw new NotImplementedException();
 }