コード例 #1
0
ファイル: ArtistaService.cs プロジェクト: AleCossioCh/Miusike
        private async Task ValidateArtista(int id)
        {
            var author = await artistaRapository.GetArtistasAsync(id);

            if (author == null)
            {
                throw new NotFoundException("invalid author to delete");
            }
            artistaRapository.DetachEntity(author);
        }
コード例 #2
0
ファイル: CancionService.cs プロジェクト: AleCossioCh/Miusike
        private async Task <ArtistaEntity> validarArtistaId(int id)
        {
            var artista = await windAppRepository.GetArtistasAsync(id);

            if (artista == null)
            {
                throw new NotFoundException($"cannot found artista with id {id}");
            }
            windAppRepository.DetachEntity(artista);
            return(artista);
        }