public async Task <IActionResult> Create([Bind(Prefix = "ProfessionalExp")] ProfessionalExp obj)
        {
            if (ModelState.IsValid)
            {
                await _professionalService.InsertAsync(obj);

                return(RedirectToRoute(new { controller = "Curriculums", action = "Details", id = obj.CurriculumId }));
            }
            return(RedirectToRoute(new { controller = "Curriculums", action = "Details", id = obj.CurriculumId }));
        }
        public async Task <IActionResult> Edit(int id, ProfessionalExp obj)
        {
            if (id != obj.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                await _professionalService.UpdateAsync(obj);

                return(RedirectToRoute(new { controller = "Curriculums", action = "Details", id = TempData["id"] }));
            }
            return(View(obj));
        }
        // Atualizar:
        public async Task UpdateAsync(ProfessionalExp obj)
        {
            bool hasAny = await _context.ProfessionalExps.AnyAsync(o => o.Id == obj.Id);

            if (!hasAny)
            {
                throw new Exception("not found");
            }
            try
            {
                _context.Update(obj);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }
        }
 public async Task InsertAsync(ProfessionalExp obj)
 {
     _context.ProfessionalExps.Add(obj);
     await _context.SaveChangesAsync();
 }