예제 #1
0
 public IActionResult Get([FromRoute] int userId)
 {
     try
     {
         IEnumerable <TimeLine> tl = _clientService.Get(userId);
         return(ApiControllerHelper.SendOk(this, new ApiResult <TimeLine>(HttpStatusCode.OK, null, tl), true));
     }
     catch (Exception ex)
     {
         return(ApiControllerHelper.SendError(this, ex));
     }
 }
예제 #2
0
        public IActionResult Index()
        {
            IEnumerable <TimeLineForm> timeLineForm = _timeLineService.Get(_sessionManager.User.Id).Select(tl => new TimeLineForm()
            {
                Id = tl.Id, DinerDate = tl.DinerDate, NbrGuests = tl.NbrGuests, RestaurantName = tl.RestaurantName
            });

            if (_sessionManager.User is not null)
            {
                return(View(timeLineForm));
            }
            else
            {
                return(RedirectToAction("Login", "Auth"));
            }
        }
예제 #3
0
 public IEnumerable <TimeLine> Get(int userId)
 {
     return(_globalService.Get(userId).Select(TL => TL.ToClient()));
 }