Пример #1
0
        public async Task <IActionResult> PutForos(int id, DataModels.Foros Foros)
        {
            if (id != Foros.Id)
            {
                return(BadRequest());
            }

            try
            {
                var mappaux = _mapper.Map <DataModels.Foros, data.Foro>(Foros);

                new BS.Foro(_context).Update(mappaux);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ForosExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
        public async Task <ActionResult <data.Foro> > PostForos(DataModels.Foros Foros)
        {
            var mappaux = _mapper.Map <DataModels.Foros, data.Foro>(Foros);

            new BS.Foro(_context).Insert(mappaux);

            return(CreatedAtAction("GetForos", new { id = Foros.Id }, Foros));
        }