using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;

namespace ManyToManyExample
{
    [ActiveRecord]
    public class Ksiazka : ActiveRecordBase
    {
        public Ksiazka() { L_Kategoria = new List<Kategoria>(); }

        [PrimaryKey]
        public int ID { get; set; }

        [Property]
        public string Tytul { get; set; }

        [Property]
        public string Tresc { get; set; }

        [HasAndBelongsToMany( typeof( Kategoria ), Table = "KsiazkaKategoria", ColumnKey = "ID_Ksiazka", ColumnRef = "ID_Kategoria", Cascade=ManyRelationCascadeEnum.SaveUpdate )]
        public IList<Kategoria> L_Kategoria { get; set; }
    }
}
