public static void Main() { IUserService userService = IoC.Resolve<IUserService>(); User user1 = new User { Email = "*****@*****.**", FirstName = "Ziyasal", LastName = "Doe" }; userService.AddUser(user1); User user2 = new User { Email = "*****@*****.**", FirstName = "John", LastName = "Doe" }; userService.AddUser(user2); foreach (User user in userService.GetAll()) { Console.WriteLine("{0} {1}", user.FirstName, user.LastName); } Console.Read(); }
public int AddUser(User user) { _userRepository.Add(user); _unitOfWork.Commit(); return user.Id; }