public async Task <IActionResult> Add(int itemId, [FromBody] ItemLesson model) { model.ItemId = itemId; var data = await _itemLessonService.Add(model); return(Ok(data)); }
public async Task <IActionResult> Edit(int itemId, int id, [FromBody] ItemLesson model) { var data = await _itemLessonService.Get(id); if (data == null || data.ItemId != itemId) { return(NotFound()); } model = await _itemLessonService.Update(model); return(base.Ok(model)); }