Example #1
0
        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());
     }
 }
Example #3
0
        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);
        }
Example #4
0
 public void UpdateEvent(EventMeetUp evntUp)
 {
     _repo.Update(evntUp);
 }
Example #5
0
 public void AddEvent(EventMeetUp evnt)
 {
     _repo.Add(evnt);
 }
Example #6
0
        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"."
        }