Esempio n. 1
0
        public ActionResult Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var eventViewModel = eventAppService.GetById((Guid)id);

            if (eventViewModel == null)
            {
                return(HttpNotFound());
            }
            return(View(eventViewModel));
        }
Esempio n. 2
0
        public IActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var eventViewModel = _eventAppService.GetById(id.Value);

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

            return(View(eventViewModel));
        }
Esempio n. 3
0
 public IActionResult GetById(Guid id)
 {
     try
     {
         var response = _mapper.Map <Event, EventViewModel>(_eventAppService.GetById(id));
         return(Ok(response));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Esempio n. 4
0
 public ActionResult <EventViewModel> Get(int id)
 {
     return(_mapper.Map <Core.Event.Event, EventViewModel>((Core.Event.Event)_eventApp.GetById(id)));
 }