public async Task <TDomain> AddAsync(TDomain newDomainEntity) { TEntity entity = _mapDomainToEntity(newDomainEntity); await _efRepository.AddAsync(entity); await _efUnitRepository.CommitAsync(); return(_mapEntityToDomain(entity)); }
public async Task <Application> AddAsync(Application application) { application.ApplicationDate = DateTime.Now.ToLongDateString(); var entity = _mapApplicationDomainToEntity(application); await _efApplicationRepository.AddAsync(entity); await _efUnitRepository.CommitAsync(); entity.Job = await _efJobRepository.FindByIdAsync(application.JobId); application = _mapApplicationEntityToDomain(entity); return(application); }