public Note AddNote(int projectId, int storyId, string text)
        {
            var path = string.Format("/projects/{0}/stories/{1}/notes", projectId, storyId);
            var noteReq = new Repository.PivotalStoryRepository.StoryNoteXmlRequest { text = text };

            var noteResp = this.RequestPivotal<StoryNoteXmlResponse>(path, noteReq, "POST");
            var note = new Note
                           {
                               Author = noteResp.author,
                               Description = noteResp.text,
                               NoteDate = noteResp.noted_at == null ? (DateTime?)null : noteResp.noted_at.DateTime.Value,
                               Id = noteResp.id,
                               StoryId = storyId
                           };
            return note;
        }
Esempio n. 2
0
        public Note AddNote(int projectId, int storyId, string text)
        {
            var path    = string.Format("/projects/{0}/stories/{1}/notes", projectId, storyId);
            var noteReq = new Repository.PivotalStoryRepository.StoryNoteXmlRequest {
                text = text
            };

            var noteResp = this.RequestPivotal <StoryNoteXmlResponse>(path, noteReq, "POST");
            var note     = new Note
            {
                Author      = noteResp.author,
                Description = noteResp.text,
                NoteDate    = noteResp.noted_at == null ? (DateTime?)null : noteResp.noted_at.DateTime.Value,
                Id          = noteResp.id,
                StoryId     = storyId
            };

            return(note);
        }
        public async Task <Note> AddNoteAsync(int projectId, int storyId, string text)
        {
            var path    = string.Format("/projects/{0}/stories/{1}/notes", projectId, storyId);
            var noteReq = new Repository.PivotalStoryRepository.StoryNoteXmlRequest {
                text = text
            };

            var noteResp = await this.RequestPivotalAsync <StoryNoteXmlResponse>(path, noteReq, "POST");

            var note = new Note
            {
                Author      = noteResp.author,
                Description = noteResp.text,
                NoteDate    = noteResp.noted_at,
                Id          = noteResp.id,
                StoryId     = storyId
            };

            return(note);
        }