Пример #1
0
        public void TestDeleteInterestPointNewsletterAsync()
        {
            BoraNowSeeder.Seed();
            var ipnbo     = new InterestPointNewsletterBusinessObject();
            var resList   = ipnbo.List();
            var resDelete = ipnbo.DeleteAsync(resList.Result.First().Id).Result;

            resList = ipnbo.ListAsync().Result;

            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.First().IsDeleted);
        }
        public async Task <IActionResult> Delete(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var deleteOperation = await _bo.DeleteAsync((Guid)id);

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