public void Delete(CarBindingModel model) { var element = CarStorage.GetElement(new CarBindingModel { Id = model.Id }); if (element == null) { throw new Exception("Элемент не найден"); } CarStorage.Delete(model); }
public async Task <ActionResult> Delete(Guid Id) { try { var response = await _carStorage.Delete(Id).ConfigureAwait(false); return(StatusCode(StatusCodes.Status200OK, response)); } catch (Exception exeption) { return(StatusCode(StatusCodes.Status500InternalServerError, exeption.Message)); } }