public HttpResponseMessage RemoveGuest(int eventID, int guestID) { var guest = _guestService.GetByID(guestID).Data; var user = guest.Host; if (user != null && !user.WindowsName.Equals(user.WindowsName)) { return(Request.CreateResponse(HttpStatusCode.Forbidden)); } var ev = _service.GetByID(eventID).Data; //guest.HostID = -1; //guest.Host = null; if (ev != null && ev.GuestsInEvent.Contains(guest)) { //ev.GuestsInEvent.Remove(guest); //_service.Update(ev); _participantsContext.RemoveGuest(new EventGuestDTO(guest)); _guestService.Delete(guest); } return(Request.CreateResponse(HttpStatusCode.OK)); }