public void Add(EducationLevelAddDto educationLevelDto) { var educationLevel = new EducationLevel() { Name = educationLevelDto.Name }; _educationLevelRepository.Add(educationLevel); }
public async Task <ActionResult <EducationLevel> > Create(EducationLevel value) { //EducationLevel obj = new EducationLevel(value); _EducationLevel.Add(value); // it will be null //var testEducationLevel = await _EducationLevel.GetById(value.); // If everything is ok then: await _uow.Commit(); // The product will be added only after commit // testProduct = await _productRepository.GetById(product.Id); return(RedirectToAction("Index")); }
public bool CreateEducationLevel(EducationLevel educationLevel) { bool isSuccess = true; try { educationLevelRepository.Add(educationLevel); this.SaveRecord(); ServiceUtil <EducationLevel> .WriteActionLog(educationLevel.Id, ENUMOperation.CREATE, educationLevel); } catch (Exception ex) { isSuccess = false; logger.Error("Error in creating EducationLevel", ex); } return(isSuccess); }