示例#1
0
        public void Delete(CarBindingModel model)
        {
            var element = CarStorage.GetElement(new CarBindingModel {
                Id = model.Id
            });

            if (element == null)
            {
                throw new Exception("Элемент не найден");
            }
            CarStorage.Delete(model);
        }
示例#2
0
        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));
            }
        }