Exemplo n.º 1
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var result = await _bo.DeleteAsync(id);

            if (!result.Success)
            {
                return(InternalServerError(result.Exception));
            }

            return(Ok());
        }
Exemplo n.º 2
0
        public void TestDeleteProposalAsync()
        {
            ApplicationSeeder.Seed();

            var bo = new ProposalBO();

            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));
        }
Exemplo n.º 3
0
        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."));
        }