public void DomainServiceTest()
 {
     IUserDomainService userDomainService = new UserDomainService(
         new UserRepository(new EntityFrameworkRepositoryContext()));
     IMessageDomainService messageDomainService = new MessageDomainService(
         new MessageRepository(new EntityFrameworkRepositoryContext()),
         new UserRepository(new EntityFrameworkRepositoryContext()));
     List<User> users = new List<User>();
     users.Add(new User { Name = "小菜" });
     users.Add(new User { Name = "大神" });
     userDomainService.AddUser(users);
     messageDomainService.DeleteMessage(null);
 }
 public void UserDomainService()
 {
     IUserDomainService userDomainService = new UserDomainService(
         new UserRepository(new EntityFrameworkRepositoryContext()));
     List<User> users = new List<User>();
     users.Add(new User { Name = "小菜" });
     users.Add(new User { Name = "大神" });
     userDomainService.AddUser(users);
     //userDomainService.ExistUser();
     //var user = userDomainService.GetUserByName("小菜");
     //if (user != null)
     //{
     //    Console.WriteLine(user.Name);
     //}
 }
 /// <summary>
 /// 初始化一个<c>UserServiceImpl</c>类型的实例。
 /// </summary>
 /// <param name="userRepository">“用户”服务实例。</param>
 public UserServiceImpl(UserDomainService userDomainService)
 {
     this.userDomainService = userDomainService;
 }