public async Task <File> Create(File objectToCreate)
        {
            await _context.AddAsync(objectToCreate);

            await _context.SaveChangesAsync();

            return(await GetById(objectToCreate.Id));
        }
예제 #2
0
        public async virtual Task <JobApplication> Create(JobApplication applicationToCreate)
        {
            await _context.AddAsync(applicationToCreate);

            await _context.SaveChangesAsync();

            return(await GetById(applicationToCreate.Id));
        }
예제 #3
0
        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));
        }