public string getComment(int id)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     CommentServiceModel comment = service.getCommentById(id);
     return JsonConvert.SerializeObject(comment);
 }
 public string getCommentsByUser(int id)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     IEnumerable<CommentServiceModel> comments = service.getCommentsByUser(id);
     return JsonConvert.SerializeObject(comments, Formatting.Indented);
 }
 public HttpResponseMessage deleteDefect(int id)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     service.deleteDefect(id);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }
 public string getCommentsBeforeDate(string datetime)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     DateTime dateTimeStamp = JsonConvert.DeserializeObject<DateTime>(datetime);
     IEnumerable<CommentServiceModel> comments = service.getCommentsBeforeDate(dateTimeStamp);
     return JsonConvert.SerializeObject(comments, Formatting.Indented);
 }
 public string getDefect(int id)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     DefectServiceModel defect = service.getDefect(id);
     return JsonConvert.SerializeObject(defect);
 }
 public HttpResponseMessage updateDefect(string json)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     throw new NotImplementedException();
 }
 public HttpResponseMessage insertDefect(string json)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     DefectServiceModel defectServiceModel = JsonConvert.DeserializeObject<DefectServiceModel>(json);
     service.insertDefect(defectServiceModel);
     return new HttpResponseMessage(HttpStatusCode.Created);
 }
 public string getDefectsByKeywordSubject(string subject)
 {
     DefectsBuilder builder = new DefectsBuilder();
     IDefectsService service = builder.Build();
     IEnumerable<DefectServiceModel> comments = service.getDefectsByKeywordSubject(subject);
     return JsonConvert.SerializeObject(comments, Formatting.Indented);
 }