public bool RegisterUser(UserRegistration user) { var userDetails = new UserDetails(); var existingUser = UserDetailsRepository.GetAll().FirstOrDefault(p => p.Email == user.Email); if (existingUser != null) { return(false); } PopulateUserDetails(userDetails, user); UserDetailsRepository.Add(userDetails); UnitOfWork.Commit(); var loginDetails = new LoginDetails() { MemberId = userDetails.MemberId }; PopulateLoginDetails(loginDetails, user); LoginDetailsRepository.Add(loginDetails); this.UnitOfWork.Commit(); return(true); }