public async Task <IActionResult> DeleteElection(string id)
        {
            var deleteResult = await _electionService.Delete(id);

            if (deleteResult.DeletedCount < 1)
            {
                return(NotFound());
            }

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task TestDelete()
        {
            try
            {
                UOW.BeginTransaction();
                Election result = await electionService.Delete(UOW, DefaultElectionId);

                UOW.CloseTransaction();
                Assert.IsNull(result);
            }
            catch (Exception ex)
            {
                Assert.IsNull(ex, "Exception Thrown: " + ex.Message);
            }
        }