示例#1
0
        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());
        }
示例#2
0
        public ActionResult Get()
        {
            IEnumerable <MobilePhone> mobilePhones = _mobileRepository.Get();

            return(Ok(mobilePhones));
        }