Beispiel #1
0
 public IActionResult GetEvents()
 {
     try
     {
         return(Ok(_localEventsRepository.GetEvents()));
     }
     catch (Exception ex)
     {
         return(BadRequest());
     }
 }
        public string formMessage()
        {
            string content = "";

            // Write content for jobs
            content += "Local jobs:";
            List <JobsViewModel> jobs = _jobsRepository.GetJobsList(0, 0, null).ToList();

            foreach (JobsViewModel job in jobs)
            {
                content += "\n\n" + job.JobTitle + "\n" + job.JobDescription;
            }

            // Write content for events
            content += "\n\nLocal events:";
            List <LocalEventsViewModel> localEvents = _localEventsRepository.GetEvents().ToList();

            foreach (LocalEventsViewModel localEvent in localEvents)
            {
                content += "\n\n" + localEvent.EventName + "\n" + localEvent.EventDescription;
            }

            return(content);
        }