Exemplo n.º 1
0
        public async Task <ActionResult <Varga> > Edit(string id, Varga value)
        {
            // var product = new Product(value.Id);
            value.Id = ObjectId.Parse(id);
            _Varga.Update(value, id);

            await _uow.Commit();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <Varga> > Create(Varga value)
        {
            //Varga obj = new Varga(value);
            _Varga.Add(value);

            // it will be null
            //var testVarga = await _Varga.GetById(value.);

            // If everything is ok then:
            await _uow.Commit();

            // The product will be added only after commit
            // testProduct = await _productRepository.GetById(product.Id);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        public ActionResult <Varga> Create()
        {
            Varga value = new Varga();

            return(View());
        }