public static DepartmentInstructorDomain Create(DepartmentInstructorModel departmanInstructor) { return(new DepartmentInstructorDomain( departmanInstructor.UserId, departmanInstructor.DepartmentId )); }
public async Task <IDataResult <long> > AddAsync(DepartmentInstructorModel request) { Check.NotNullOrEmpty(request, "request"); var departmentInstructorDomain = DepartmentInstructorDomainFactory.Create(request); var departmentInstructorEntity = departmentInstructorDomain.Map <DepartmentInstructorEntity>(); await _departmentInstructorRepository.AddAsync(departmentInstructorEntity); await _databaseUnitOfWork.SaveChangesAsync(); return(new SuccessDataResult <long>(departmentInstructorEntity.DepartmentInstructorId)); }
public async Task <IActionResult> AddAsync(DepartmentInstructorModel request) { var result = await _departmentInstuctorService.AddAsync(request); return(new ActionIResult(result)); }