Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #4
0
 public Task Save()
 {
     return(_appDbContext.SaveChangesAsync());
 }