public async Task<FacultyModel> Add(CreateFacultyModel model) { var university = await _repository.GetAllDependenciesById(model.UniversityId); var faculty = _mapper.Map<Faculty>(model); university.AddFaculty(faculty); _repository.Update(university); await _repository.SaveChanges(); return _mapper.Map<FacultyModel>(faculty); }
public async Task Delete(Guid universityId) { var university = await _universitiesRepository.GetAllDependenciesById(universityId); _universitiesRepository.Delete(university); await _universitiesRepository.SaveChanges(); }