Пример #1
0
        public void TestDeleteEstablishmentAsync()
        {
            ContextSeeder.Seed();
            var bo        = new CompanyBusinessObject();
            var resList   = bo.ListAsync().Result;
            var resDelete = bo.DeleteAsync(resList.Result.First().Id).Result;

            resList = bo.ListNotDeletedAsync().Result;
            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.Count == 0);
        }
Пример #2
0
        public void TestDeleteInterestPointCategoryAsync()
        {
            BoraNowSeeder.Seed();
            var bo        = new CompanyBusinessObject();
            var resList   = bo.List();
            var resDelete = bo.DeleteAsync(resList.Result.First().Id).Result;

            resList = bo.ListAsync().Result;

            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.First().IsDeleted);
        }
        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));
            }
            else
            {
                return(OperationSuccess("The record was successfuly deleted"));
            }
        }