Example #1
0
        public async Task <bool> Delete(int articleId)
        {
            var result = true;

            try
            {
                var articleFound = _articlesDbContext.Articles.FirstOrDefault(art => art.Id == articleId);
                _articlesDbContext.Remove(articleFound);
                await _articlesDbContext.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                result = false;
            }
            return(result);
        }