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