示例#1
0
        // GET: Pack
        public ActionResult Index()
        {
            List <Pack> list = new List <Pack>();

            foreach (var item in PackService.GetAll())
            {
                Pack AVM = new Pack();
                AVM.Id              = item.Id;
                AVM.date_deb        = item.date_deb;
                AVM.date_expiration = item.date_expiration;
                AVM.ListPanier      = item.ListPanier;
                AVM.ListProduct     = item.ListProduct;
                AVM.Price           = item.Price;


                list.Add(AVM);
            }
            return(View(list));
        }
示例#2
0
 public async Task <IActionResult> GetPacks()
 {
     return(Ok(await _packService.GetAll()));
 }
示例#3
0
        public async Task <IList <Pack> > Get()
        {
            var userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; //TODO move to currentUserContext

            return(await _packService.GetAll(userId));
        }