Beispiel #1
0
        public async Task <IHttpActionResult> CreateGroup(Group group)
        {
            if (ModelState.IsValid)
            {
                await _valueProvider.CreateValueAsync(group);

                return(CreatedAtRoute("DefaultApi", new { id = group.GroupId }, group));
            }
            return(BadRequest(ModelState));
        }
Beispiel #2
0
        public async Task <IHttpActionResult> CreateToDoList(ToDoList item)
        {
            if (ModelState.IsValid)
            {
                await _valueProvider.CreateValueAsync(item);

                var dto = Convert(item);

                return(CreatedAtRoute("DefaultApi", new { id = item.NoteId }, dto));
            }
            return(BadRequest(ModelState));
        }