public IActionResult Delete(int id) { try { PriceList db_priceList = _priceContext.GetWithId(id); if (db_priceList == null) { return(StatusCode(StatusCodes.Status500InternalServerError, new Response { Status = "Error", Messages = new Message[] { new Message { Lang_id = 1, MessageLang = "Model state isn't valid!" }, new Message { Lang_id = 2, MessageLang = "Состояние модели недействительно!" }, new Message { Lang_id = 3, MessageLang = "Model vəziyyəti etibarsızdır!" } } })); } _priceContext.Detele(db_priceList.Id); return(Ok()); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } }