public async Task <StatusCodeResult> Delete(int id)
 {
     if (await _service.DeleteAsync(id) == 1)
     {
         return(StatusCode((int)HttpStatusCode.OK));
     }
     else
     {
         return(StatusCode((int)HttpStatusCode.ExpectationFailed));
     }
 }
        public async Task <ActionResult> DeleteSingleRegistration([FromRoute] int workshopId, [FromRoute] int registrationId)
        {
            Registration registration = await _registrationRepo.GetSingleRegistration(workshopId, registrationId);

            if (registration == null)
            {
                return(NotFound(new { error = $"registration with id {registrationId} could not be found in workshop with id {workshopId}" }));
            }
            await _registrationRepo.DeleteAsync(registration);

            return(NoContent());
        }
예제 #3
0
 public async Task <int> DeleteAsync(Guid id)
 {
     return(await registrationRepository.DeleteAsync(id));
 }
        public async Task <ActionResult> DeleteConfirmed(string id)
        {
            await _repository.DeleteAsync(id);

            return(RedirectToAction("Index"));
        }