public async Task <File> Create(File objectToCreate) { await _context.AddAsync(objectToCreate); await _context.SaveChangesAsync(); return(await GetById(objectToCreate.Id)); }
public async virtual Task <JobApplication> Create(JobApplication applicationToCreate) { await _context.AddAsync(applicationToCreate); await _context.SaveChangesAsync(); return(await GetById(applicationToCreate.Id)); }
public virtual async Task <Candidate> Create(Candidate objectToCreate) { await _context.AddAsync(objectToCreate); if (await _context.SaveChangesAsync() == 0) { throw new Exception("Candidate not created"); } return(await GetById(objectToCreate.Id)); }