Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Status,TenantId")] User user)
        {
            if (ModelState.IsValid)
            {
                _repository.Create(user);
                await _unitOfWork.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            //ViewData["TenantId"] = new SelectList(_context.Tenant, "Id", "Id", user.TenantId);
            return(View(user));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,UserId,TenantId,OrderDes")] Order order)
        {
            if (ModelState.IsValid)
            {
                _repository.Create(order);
                await _unitOfWork.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TenantId"] = new SelectList(_tenantRepository.GetAll(), "Id", "Id");
            ViewData["UserId"]   = new SelectList(_userRepository.GetAll(), "Id", "Id");
            return(View(order));
        }