public async Task <IActionResult> Create([Bind("ID,company,title,job_number,last_checked,last_updated,date_applied,status,notes,interview,rejected,city,state,country")] JobsModel jobsModel) { if (ModelState.IsValid) { _context.Add(jobsModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(jobsModel)); }
/// <summary/> public async Task <TEntity> InsertEntity(TEntity entity, bool autoSave = true) { entity.Id = Guid.NewGuid(); _dbContext.Add(entity); if (autoSave) { await Save(); } return(entity); }
public void CreateCompany(Company newCompany) { using var db = new JobsContext(); db.Add(newCompany); db.SaveChanges(); }
public void CreateJob(Jobs newJob) { using var db = new JobsContext(); db.Add(newJob); db.SaveChanges(); }