예제 #1
0
        public async Task <IActionResult> PutFoci(int id, datamodels.Foci foci)
        {
            if (id != foci.FocusId)
            {
                return(BadRequest());
            }

            try
            {
                var mapaux = _mapper.Map <datamodels.Foci, data.Foci>(foci);

                new Solution.BS.Foci(_context).Update(mapaux);
            }
            catch (Exception ee)
            {
                if (!FociExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult <datamodels.Foci> > PostFoci(datamodels.Foci foci)
        {
            var mapaux = _mapper.Map <datamodels.Foci, data.Foci>(foci);

            new Solution.BS.Foci(_context).Insert(mapaux);

            return(CreatedAtAction("GetFoci", new { id = foci.FocusId }, foci));
        }