public async Task <IActionResult> Delete(int id)
        {
            var place = await _placeRepository.GetById(id);

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

            var deleted = await _placeRepository.Delete(id);

            return(Ok(deleted));
        }
        public ActionResult DeletePlace(int facilityID, int placeID)
        {
            User     user     = UserRep.FindByEmail(User.Identity.Name);
            Facility facility = FacilityRep.Find(facilityID);
            Place    place    = PlaceRep.Find(placeID);

            if (place.FacilityID != facilityID)
            {
                return(new ForbidResult());
            }
            else if (FacilityRep.IsAdmin(user, facility))
            {
                PlaceRep.Delete(placeID);
                return(Ok());
            }
            else
            {
                return(new ForbidResult());
            }
        }
Ejemplo n.º 3
0
 public void Delete()
 {
     mPlaceRepository.Delete(this);
 }
Ejemplo n.º 4
0
 private async Task <bool> DeleteEventPlace(Guid placeId)
 {
     return(await _placeRepository.Delete(placeId));
 }