public async Task <ActionResult <Label> > AddLabel([FromBody] Label label) { var res = await lr.AddLabel(label, HttpContext.Items["UserID"].ToString()); if (res == null) { return(BadRequest("Label with same name already exists")); } return(res); }
public void AddLabelTest() { LabelRepository repository = new LabelRepository(); LabelModel label = new LabelModel { LabelId = 1, LabelName = "Sample", NoteId = 1 }; Assert.IsNotNull(repository.AddLabel(label)); }