Are you referring to "Hello World" with NHibernate? Because if you are,
there are more steps after the one you're talking about. 2.1.5 creates the
code to save, then it carry's on explaining things until you get to 2.1.8
where you actually configure your application.

On Sun, Feb 15, 2009 at 12:34 PM, Peter Morris <[email protected]> wrote:

>
> The book simply says this
>
> 01: Create a console app
> 02: Add an Employee class
>
>  public class Employee
>  {
>  public int ID;
>  public string Name;
>  public Employee Manager;
>
>  public string SayHello()
>  {
>   return string.Format(
>   "'Hello World!', said {0}.", Name);
>  }
>  }
>
> 03: Create the DB
> 04: Run the following code...
>
>
>  class Program
>  {
>  static ISessionFactory Factory;
>
>  static void Main(string[] args)
>  {
>   Employee fred = new Employee();
>   fred.Name = "Fred Bloggs";
>
>   using (var session = OpenSession())
>   {
>    using (var transaction = session.BeginTransaction())
>    {
>     session.Save(fred);
>     transaction.Commit();
>    }//transaction
>   }//using session
>
>   Console.WriteLine(fred.SayHello());
>   Console.ReadLine();
>  }
>
>  static ISession OpenSession()
>  {
>   if (Factory == null)
>   {
>    var configuration = new Configuration();
>    configuration.AddAssembly(typeof(Employee).Assembly);
>    Factory = configuration.BuildSessionFactory();
>   }
>   return Factory.OpenSession();
>  }
>  }
>
>
> That's it.  The problem is, it doesn't even set a connection string, so how
> can it possibly work?  That aside though, I'd expect it at least to get
> past
> the BuildSessionFactory line.
>
>
> I'm starting to suspect this book may have been a waste of money!
>
>
> Pete
> ====
> http://mrpmorris.blogspot.com
> http://www.capableobjects.com - Think domain, not database
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to