public void Save() { var a = _uow.GetHashCode(); var b = _roleRepository.GetHashCode(); var c = _userRepository.GetHashCode(); using (_uow) { //var a = _roleRepository.GetByKey(21); var role = new Role() { Code = "001", Name = "role001" }; var rolelist = new List <Role>() { new Role() { Code = "003", Name = "role001" }, new Role() { Code = "004", Name = "role001" } }; var user = new User() { Code = "003", Name = "user003", RoleId = 22 }; //throw new Exception("this is a excepetion!!"); _roleRepository.Save(); _userRepository.Save(); _uow.Commit(); } }