Esempio n. 1
0
        public IHttpActionResult Get(int id)
        {
            try
            {
                UserCouponPackageVM result = AutoMapper.Mapper.Map <UserCouponPackage, UserCouponPackageVM>
                                                 (_userCouponPackageService.GetUserCouponPackage(id));

                return(Ok(result));
            }
            catch (Exception e)
            {
                return(InternalServerError(e));
            }
        }
Esempio n. 2
0
        public IHttpActionResult GetSingle(int id)
        {
            try
            {
                UserCouponPackageVM result = AutoMapper.Mapper.Map <UserCouponPackage, UserCouponPackageVM>
                                                 (_userCouponPackageService.GetUserCouponPackage(_ => _.Id == id && _.UserId == CURRENT_USER_ID, _ => _.CouponItems));

                return(Ok(result));
            }
            catch (Exception e)
            {
                return(InternalServerError(e));
            }
        }