Ejemplo n.º 1
0
        public IActionResult Counter()
        {
            Counter counter = new Counter
            {
                Count = CounterDB.GetCounter()
            };

            return(View(counter));
        }
Ejemplo n.º 2
0
        public IActionResult Counter(int value)
        {
            int  count  = CounterDB.GetCounter() + 1;
            bool result = CounterDB.UpdateCounter(count);

            Counter counter = new Counter();

            if (result)
            {
                counter.Count = count;
            }
            else
            {
                counter.Count = count - 1;
            }

            return(View(counter));
        }