public async Task <IActionResult> Create([Bind("IsPayed,PaymentUrl,DeliveryAddress,OrderStatus,Id,CreationDate,DeletedDate")] Order order)
        {
            if (ModelState.IsValid)
            {
                order.Id = Guid.NewGuid();
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
        public async Task <IActionResult> Create([Bind("PhoneNumber,VerificationCode,FullName,NotificationDeviceId,Id,CreationDate,DeletedDate")] User user)
        {
            if (ModelState.IsValid)
            {
                user.Id = Guid.NewGuid();
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Exemple #3
0
        public async Task <IActionResult> Create([Bind("Name,ImageUrl,Id,CreationDate,DeletedDate")] Category category)
        {
            if (ModelState.IsValid)
            {
                category.Id = Guid.NewGuid();
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }