public EventMeetUp EventWithOutAtt(int id) { EventMeetUp evnt = (from e in _repo.Query <EventMeetUp>() where e.Id == id select e).FirstOrDefault(); return(evnt); }
public IActionResult Post([FromBody] EventMeetUp evnt) { if (evnt == null) { return(BadRequest()); } else if (evnt.Id == 0) { _evntService.AddEvent(evnt); return(Ok()); } else { _evntService.UpdateEvent(evnt); return(Ok()); } }
public EventMeetUp GetEvent(int id) // { EventMeetUp gEvent = (from e in _repo.Query <EventMeetUp>() where e.Id == id select new EventMeetUp { Id = e.Id, Title = e.Title, Attendees = e.Attendees, Description = e.Description, MaxCapacity = e.MaxCapacity, Location = e.Location, Start = e.Start, End = e.End, }).FirstOrDefault(); return(gEvent); }
public void UpdateEvent(EventMeetUp evntUp) { _repo.Update(evntUp); }
public void AddEvent(EventMeetUp evnt) { _repo.Add(evnt); }
public void DeleteEvent(int id) { EventMeetUp delEvent = GetEvent(id); _repo.Delete(delEvent); //---------the "GetEvent is a method wich gets a single event stored is inside the var "gEvent"." }