Exemplo n.º 1
0
        public IHttpActionResult AddTask(HttpRequestMessage requestMessage, NewTask newTask)
        {
            var task = _addTaskMaintenanceProcessor.AddTask(newTask);

            var result = new TaskCreatedActionResult(requestMessage, task);

            return result;
        }
        public Task AddTask(NewTask newTask)
        {
            var taskEntity = _autoMapper.Map<Data.Entities.Task>(newTask);

            _queryProcessor.AddTask(taskEntity);

            var task = _autoMapper.Map<Task>(taskEntity);

            _taskLinkService.AddLinks(task);

            return task;
        }
 public Task AddTask(NewTask newTask)
 {
     var taskEntity = _autoMapper.Map<Data.Entities.Task>(newTask);
     _queryProcessor.AddTask(taskEntity);
     var task = _autoMapper.Map<Task>(taskEntity);
     // TODO: Implement link service
     task.AddLink(new Link
     {
         Method = HttpMethod.Get.Method,
         Href = "http://localhost:61589/api/v1/tasks/" + task.TaskId,
         Rel = WebApi2Book.Common.Constants.CommonLinkRelValues.Self
     });
     return task;
 }
Exemplo n.º 4
0
 public Task AddTask(HttpRequestMessage requestMessage, NewTask newTask)
 {
     var task = _addTaskMaintenanceProcessing.AddTask(newTask);
     return task;
 }