Exemplo n.º 1
0
        public int Create(CompanyUserDto companyUserDto)
        {
            var companyuser = new CompanyUser()
            {
                CreatedUser      = companyUserDto.CreatedUser,
                CreateDate       = companyUserDto.CreateDate,
                ModifyDate       = companyUserDto.ModifyDate,
                ModifiedUser     = companyUserDto.ModifiedUser,
                FirstName        = companyUserDto.FirstName,
                LastName         = companyUserDto.LastName,
                TrIdentityNumber = companyUserDto.TrIdentityNumber,
                Title            = companyUserDto.Title,
                Email            = companyUserDto.Email,
                MobileNumber     = companyUserDto.MobileNumber,
                CompanyId        = companyUserDto.CompanyId,
                AccountId        = companyUserDto.AccountId,
                Address          = new Address()
            };

            companyUserRepository.Insert(companyuser);
            unitOfWork.SaveChanges();

            return(companyuser.Id);
        }