public int GetQtd(string guid)
        {
            IPersist <Carrinho> car = NewMethod();

            Model.Carrinho iten = car.Get(guid);
            return(iten.Produtos.Count());
        }
        public List <Model.Shopping> GetShopping(string guid)
        {
            IPersist <Carrinho> car = NewMethod();

            Model.Carrinho iten = car.Get(guid);

            var itens = (from Model.Produto item in iten.Produtos
                         group item by item.Id into newitem
                         orderby newitem.Key
                         select new Model.Shopping
            {
                Contagem = newitem.Count(),
                ValorTotal = newitem.Sum(x => x.Valor),
                Produto = newitem.First(),
            }).ToList();

            return(itens);
        }
예제 #3
0
        public List <string> ProbeAseManagement(string aseName)
        {
            // get new ips
            var newIps = _azmgmt.GetManagementIps(aseName);
            // get old ips
            var oldIps = _blobstg.Get(aseName);
            // determine missing ips
            List <String> missingIps = new List <String>();

            foreach (string ip in newIps.endpoints)
            {
                if (oldIps == null || !oldIps.endpoints.Contains(ip))
                {
                    missingIps.Add(ip);
                }
            }
            if (missingIps.Count > 0)
            {
                _webhook.Notify(newIps);
                _blobstg.Save(aseName, newIps);
            }
            return(missingIps);
        }