コード例 #1
0
 public void UserProfileCreatedEventRaised()
 {
     DomainEvents.Register <UserProfileCreatedEvent>((ev) =>
     {
         Assert.AreEqual(_defaultProfile.Id, ev.UserProfileId);
     });
     _userProfileDomainService.RegisterNewProfile(_defaultProfile);
 }
コード例 #2
0
        public bool Handle(RegisterNewProfileCommand message)
        {
            message.NotNull();
            Address             address             = Address.Factory.Create(message.UserProfile.AddressCity);
            LoginData           loginData           = LoginData.Factory.Create(message.UserProfile.Login, message.UserProfile.Password);
            PersonalInformation personalInformation = PersonalInformation.Factory.Create(message.UserProfile.FirstName, message.UserProfile.LastName);
            User user = User.Factory.Create(personalInformation, address, loginData);

            return(_userProfileDomainService.RegisterNewProfile(user));
        }