Exemple #1
0
        public async Task <IActionResult> PutStores(int id, DataModels.Stores stores)
        {
            if (id != stores.StoreId)
            {
                return(BadRequest());
            }
            try
            {
                var mapaux = _mapper.Map <datamodels.Stores, data.Stores>(stores);

                new BS.Stores(_context).Update(mapaux);
            }
            catch (Exception)
            {
                if (!StoresExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #2
0
        public async Task <ActionResult <DataModels.Stores> > PostStores(DataModels.Stores stores)
        {
            var mapaux = _mapper.Map <datamodels.Stores, data.Stores>(stores);

            new BS.Stores(_context).Insert(mapaux);

            return(CreatedAtAction("GetStores", new { id = stores.StoreId }, stores));
        }