public void TestDeleteCommentAsync()
        {
            ApplicationSeeder.Seed();

            var bo = new CommentBO();

            var resList = bo.ListAsync().Result;
            var total   = resList.Result.Count;

            var resDelete = bo.DeleteAsync(resList.Result.First().Id).Result;

            var list = bo.ListUndeletedAsync().Result;

            Assert.IsTrue(resDelete.Success && resList.Success && list.Result.Count == (total - 1));
        }
        public async Task <IActionResult> Delete(Guid?id)
        {
            if (id == null)
            {
                return(RecordNotFound());
            }

            var deleteOperation = await _bo.DeleteAsync((Guid)id);

            if (!deleteOperation.Success)
            {
                return(OperationErrorBackToIndex(deleteOperation.Exception));
            }

            return(OperationSuccess("The record was successfully deleted."));
        }