Пример #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Title,Description")] Feature feature)
        {
            if (ModelState.IsValid)
            {
                _context.Add(feature);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(feature));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,Description,Size,Color,Material,Country")] Features features)
        {
            if (ModelState.IsValid)
            {
                _context.Add(features);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(features));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("Id,UserId,FeatureId")] UserFeature userFeature)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userFeature);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FeatureId"] = new SelectList(_context.Features, "Id", "Title", userFeature.FeatureId);
            return(View(userFeature));
        }
Пример #4
0
 public Task Save()
 {
     return(_appDbContext.SaveChangesAsync());
 }