using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord.Framework;
using Castle.ActiveRecord.Framework.Config;
using Castle.ActiveRecord;
using System.Reflection;

namespace OneToOneExample
{
    class Program
    {
        static void Main( string[] args )
        {
            IConfigurationSource source = ActiveRecordSectionHandler.Instance;
            ActiveRecordStarter.Initialize( Assembly.GetAssembly( typeof( Program ) ), source );
            ActiveRecordStarter.DropSchema();
            ActiveRecordStarter.CreateSchema();

            var o = new Osoba
            {
                Imie = "Jan",
                Nazwisko = "Kowalski"
            };
            o.Save(); // Za drugim razem odkomentowujemy i patrzymy do bazy d.
            var a = new Adres { Miasto = "Wrocław", Osoba = o };
            a.Save();
        }
    }
}
