public IObservable <ITask> Create(ITask task) { var endPoint = endPoints.Post(task.WorkspaceId, task.ProjectId); var taskCopy = task as Task ?? new Task(task); var observable = CreateObservable(endPoint, AuthHeader, taskCopy, SerializationReason.Post); return(observable); }
public Task <ITask> Create(ITask task) { var endPoint = endPoints.Post(task.WorkspaceId, task.ProjectId); var taskCopy = task as TogglTask ?? new TogglTask(task); return(SendRequest(endPoint, AuthHeader, taskCopy, SerializationReason.Post) .Upcast <ITask, TogglTask>()); }