示例#1
0
        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);
        }
示例#2
0
        public void AddLabelTest()
        {
            LabelRepository repository = new LabelRepository();
            LabelModel      label      = new LabelModel
            {
                LabelId   = 1,
                LabelName = "Sample",
                NoteId    = 1
            };

            Assert.IsNotNull(repository.AddLabel(label));
        }