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