Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo 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));
     }
 }
Ejemplo n.º 4
0
 public ActionResult <EventViewModel> Get(int id)
 {
     return(_mapper.Map <Core.Event.Event, EventViewModel>((Core.Event.Event)_eventApp.GetById(id)));
 }