コード例 #1
0
        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));
        }
コード例 #2
0
        /// <summary/>
        public async Task <TEntity> InsertEntity(TEntity entity, bool autoSave = true)
        {
            entity.Id = Guid.NewGuid();
            _dbContext.Add(entity);

            if (autoSave)
            {
                await Save();
            }

            return(entity);
        }
コード例 #3
0
 public void CreateCompany(Company newCompany)
 {
     using var db = new JobsContext();
     db.Add(newCompany);
     db.SaveChanges();
 }
コード例 #4
0
 public void CreateJob(Jobs newJob)
 {
     using var db = new JobsContext();
     db.Add(newJob);
     db.SaveChanges();
 }