예제 #1
0
        public void Update(DetailModel detailModel)
        {
            Detail detail = new Detail
            {
                Id    = detailModel.Id,
                CarId = detailModel.CarId,
                Name  = detailModel.Name,
                Price = detailModel.Price
            };

            repository.Update(detail);
        }
        public ActionResult UpdateDetails([FromBody] ArticleDetails articleDetails)
        {
            var article = detailsRepository.SelectById(articleDetails.ArticleId);

            if (article == null)
            {
                return(BadRequest("Not valid article id. Id:" + articleDetails.ArticleId));
            }

            detailsRepository.Update(articleDetails);
            detailsRepository.Save();

            return(Ok());
        }
        public async Task <ActionResult> Edit(Details editedDetail)
        {
            await details.Update(editedDetail);

            return(RedirectToAction("Index"));
        }