예제 #1
0
        public async Task <ActionResult> Delete(int id, CancellationToken ct = default)
        {
            try
            {
                if (await _BlazorSupervisor.GetAlbumByIdAsync(id, ct) == null)
                {
                    return(NotFound());
                }

                if (await _BlazorSupervisor.DeleteAlbumAsync(id, ct))
                {
                    return(Ok());
                }

                return(StatusCode(500));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex));
            }
        }