Пример #1
0
        public void Register(UserRegistrationModel userRegistrationModel)
        {
            var user = _mapper.Map <User>(userRegistrationModel);

            user.UserType = 2;
            _capstoneContext.Add(user);
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,Name")] UserType userType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userType));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("Id,Name,Description")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
Пример #4
0
 public void Save(Category category)
 {
     _capstoneContext.Add(category);
 }
Пример #5
0
 public void Save(Store store)
 {
     _capstoneContext.Add(store);
 }
Пример #6
0
 public void Save(Products products)
 {
     _capstoneContext.Add(products);
 }