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/TaskManager.Web.Api/api/v1/tasks/" + task.TaskId,
                Rel = Constants.CommonLinkRelValues.Self
            });

            return task;
        }
Пример #2
0
 public IHttpActionResult AddTask(HttpRequestMessage requestMessage, NewTask newTask)
 {
     var task = _addTaskMaintenanceProcessor.AddTask(newTask);
     var result = new TaskCreatedActionResult(requestMessage, task);
     return result;
 }