コード例 #1
0
ファイル: GenerosController.cs プロジェクト: damiandar/Series
        public async Task <ActionResult> Delete(int id)
        {
            var existe = await context.Generos.AnyAsync(x => x.Id == id);

            if (!existe)
            {
                return(NotFound());
            }

            context.Remove(new Genero()
            {
                Id = id
            });
            await context.SaveChangesAsync();

            return(NoContent());
        }