示例#1
0
        public async Task <Models.Companies.Jobs.Job> EditJob(Models.Companies.Jobs.Job job)
        {
            if (job == null)
            {
                return(null);
            }
            else
            {
                var _job = await _context.Jobs.FindAsync(job.JobId);

                _job = job;
                _context.Entry(_job).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                _context.SaveChanges();
                return(_job);
            }
        }
        public async Task <Resume> EditResume(Resume newResume)
        {
            //fluent validation
            if (newResume == null)
            {
                return(null);
            }
            else
            {
                var resume = await _context.Resumes.FindAsync(newResume.Id); // perg oscar

                resume = newResume;
                _context.Entry(resume).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                _context.SaveChanges();
                return(resume);
            }
        }
示例#3
0
        public async Task <User> EditUserProfile(User userEdited)
        {
            var user = await _context.Users.FindAsync(userEdited.CPF);

            if (user == null)
            {
                return(null);
            }
            else
            {
                user = userEdited;
                _context.Entry(user).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                return(user);
            }
        }
示例#4
0
        public async Task <Company> EditCompanyProfile(Company companyEdited)
        {
            var company = await _context.Companies.FindAsync(companyEdited.Id);

            if (company == null)
            {
                return(null);
            }
            else
            {
                company = companyEdited;
                _context.Entry(company).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                return(company);
            }
        }
示例#5
0
        public async Task <Post> EditPost(Post post)
        {
            if (post == null)
            {
                return(null);
            }
            else
            {
                var _post = await _context.Posts.FindAsync(post.Id);

                _post = post;

                _context.Entry(_post).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                await _context.SaveChangesAsync();

                return(post);
            }
        }
示例#6
0
        public async Task <Event> EditEvent(Event evento)
        {
            // fluent validation
            if (evento == null)
            {
                return(null);
            }
            else
            {
                var _event = await _context.Events.FindAsync(evento.Id);

                _event = evento;

                _context.Entry(_event).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                await _context.SaveChangesAsync();

                return(evento);
            }
        }
示例#7
0
        public async Task <Requirement> EditRequirement(Requirement requirement)
        {
            // fluent validation
            if (requirement == null)
            {
                return(null);
            }
            else
            {
                var _requirement = await _context.Requirements.FindAsync(requirement.Id);

                _requirement = requirement;

                _context.Entry(_requirement).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                await _context.SaveChangesAsync();

                return(requirement);
            }
        }
示例#8
0
        public async Task <Differential> EditDifferential(Differential differential)
        {
            // fluent validation
            if (differential == null)
            {
                return(null);
            }
            else
            {
                var _differential = await _context.Differentials.FindAsync(differential.Id);

                _differential = differential;

                _context.Entry(_differential).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                await _context.SaveChangesAsync();

                return(differential);
            }
        }
        public async Task <Experience> EditExperience(Experience experience)
        {
            // fluuent validation
            if (experience == null)
            {
                return(null);
            }
            else
            {
                var _experience = await _context.Experiences.FindAsync(experience.Id);

                _experience = experience;

                _context.Entry(_experience).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                await _context.SaveChangesAsync();

                return(experience);
            }
        }
示例#10
0
        public async Task <Education> EditEducation(Education education)
        {
            // fluent validation
            if (education == null)
            {
                return(null);
            }
            else
            {
                var _education = await _context.Education.FindAsync(education.Id);

                _education = education;

                _context.Entry(_education).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                await _context.SaveChangesAsync();

                return(education);
            }
        }
示例#11
0
        public async Task <Advertisement> EditAdvertisement(Advertisement advertisement)
        {
            // fluuent validation
            if (advertisement == null)
            {
                return(null);
            }
            else
            {
                var _advertisement = await _context.Advertisements.FindAsync(advertisement.Id);

                _advertisement = advertisement;

                _context.Entry(_advertisement).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                await _context.SaveChangesAsync();

                return(advertisement);
            }
        }