public async Task <IActionResult> PutMarcaProductos(int id, datamodels.MarcaProductos marcaProductos) { if (id != marcaProductos.IdMarca) { return(BadRequest()); } try { var mapaux = _mapper.Map <datamodels.MarcaProductos, data.MarcaProductos>(marcaProductos); new Solution.BS.MarcaProductos(_context).Update(mapaux); } catch (Exception ee) { if (!MarcaProductosExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <datamodels.MarcaProductos> > PostMarcaProductos(datamodels.MarcaProductos marcaProductos) { var mapaux = _mapper.Map <datamodels.MarcaProductos, data.MarcaProductos>(marcaProductos); new Solution.BS.MarcaProductos(_context).Insert(mapaux); return(CreatedAtAction("GetMarcaProductos", new { id = marcaProductos.IdMarca }, marcaProductos)); }