public async Task <IActionResult> Create([Bind("Name,Id,IsActive,CreDate")] EducationEntity educationEntity) { if (ModelState.IsValid) { await _educationRepository.AddAsync(educationEntity); return(RedirectToAction(nameof(Index))); } return(View(educationEntity)); }
public async Task <EducationResponse> SaveAsync(Education education) { try { await _educationRepository.AddAsync(education); await _unitOfWork.CompleteAsync(); return(new EducationResponse(education)); } catch (Exception e) { return(new EducationResponse($"An error occurred when saving the education: {e.Message}")); } }