Exemplo n.º 1
0
        public async Task DeleteAttachedFile(int id)
        {
            var announcement = await repository.FindById(id);

            if (!announcement.HasAttachedFile)
            {
                return;
            }

            await fileAccessor.DeleteAsync(announcement.AttachedFilePath.Value);

            announcement.DeleteAttachedFilePath();
            await this.repository.Update(announcement);
        }