Neo quickstart
<database name="movies" package="Movies.Model" defaultIdMethod="native"> <table name="person"> <column name="person_id" primaryKey="true" hidden="true" type="INTEGER" /> <column name="name" required="true" type="VARCHAR" size="500" /> </table> <table name="movie"> <column name="movie_id" primaryKey="true" hidden="true" type="INTEGER" /> <column name="title" required="true" type="VARCHAR" size="500" /> <column name="director_id" required="true" hidden="true" type="INTEGER" /> <foreign-key foreignTable="persons" name="Director"> <reference local="director_id" foreign="person_id"/> </foreign-key> </table> </database>
IDataStore store = new SqlDataStore(" ... connection string ... "); ObjectContext context = new ObjectContext(store); MovieFactory factory = new MovieFactory(context); Movie starwars = factory.Find("title = 'Star Wars'); Person george = new PersonFactory(context).CreateObject(); george.Name = "George Lucas"; starwars.Director = george; context.SaveChanges();
As easy as that! Now please check the documentation.