public async Task <IActionResult> Update([FromRoute] int id, [FromBody] TapeInputModel inputModel) { var tape = await TapesService.GetSingle(id); tape.Title = inputModel.Title; tape.Type = inputModel.Type; tape.ReleaseDate = inputModel.ReleaseDate; tape.Eidr = inputModel.Eidr; tape.DirectorFirstName = inputModel.DirectorFirstName; tape.DirectorLastName = inputModel.DirectorLastName; TapesService.Update(tape); return(NoContent()); }
public async Task <IActionResult> Delete([FromRoute] int id) { TapesService.Delete(await TapesService.GetSingle(id)); return(NoContent()); }
public async Task <IActionResult> GetSingle([FromRoute] int id) { var tape = await TapesService.GetSingle(id); return(Ok(tape.ToDto())); }