Esempio n. 1
0
 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));
        }
Esempio n. 3
0
        public async Task <IActionResult> AddAsync(DepartmentInstructorModel request)
        {
            var result = await _departmentInstuctorService.AddAsync(request);

            return(new ActionIResult(result));
        }