public ActionResult PutMobile([FromBody] MobileForm model) { var dbModel = mobileRepository.Get(model.Id); if (dbModel == null) { return(NotFound()); } mapper.Map <MobileForm, Mobile>(model, dbModel); mobileRepository.Update(dbModel); return(Ok()); }
public ActionResult Get() { IEnumerable <MobilePhone> mobilePhones = _mobileRepository.Get(); return(Ok(mobilePhones)); }