コード例 #1
0
        public async Task <EmployeeInfo> AddEmployeeInfoAsync(EmployeeAddRequest employeeAddRequest)
        {
            DateTime     dateTime     = DateTime.UtcNow;
            EmployeeInfo employeeInfo = new EmployeeInfo
            {
                FirstName  = employeeAddRequest.FirstName,
                LastName   = employeeAddRequest.LastName,
                Email      = employeeAddRequest.Email,
                NationalID = employeeAddRequest.NationalID
            };
            await employeeInfoRepository.CreateAsync(employeeInfo);

            if (await employeeInfoRepository.EntitySaveChangeAsync())
            {
                return(employeeInfo);
            }
            else
            {
                throw new ApiExceptions("somthing went wrong");
            }
        }