Ejemplo n.º 1
0
        public IHttpActionResult DeleteBox(int id)
        {
            // Box box = db.Boxes.Find(id);
            Box dbBox = _boxRepository.GetFirstOrDefault(b => b.PawzeUser.UserName == User.Identity.Name && b.BoxId == id);

            if (dbBox == null)
            {
                return(NotFound());
            }

            _boxRepository.Delete(dbBox);
            _unitOfWork.Commit();

            return(Ok(Mapper.Map <BoxesModel>(dbBox)));
        }