This project is read-only.

Documentation plans?

Oct 13, 2010 at 11:19 AM

Hi, I am tinkering with nHydrate, having previously used Doctrine (an ORM for PHP).

Sadly, I am finding exceptionally difficult to get going. The documentation seems really sparse, and although the product looks great, I can't find an easy way through.

For example, I haven't been able to find an easy example of creating an object from scratch and persisting it, which is pretty basic - it may be somewhere on your site, but I've not found it. I can find loads of examples which load an object from a db, change and then persist it, but not creating it from scratch. Same with adding related objects - I can find code to read a collection of objects e.g. Orders.OrderLines, but not code to add an OrderLine. Also I can't find a decent explanation of using the DTO objects, and that's just for starters.

In comparison, Doctrine documentation has a pretty comprehensive 'How to' section covering each area of the product, and it also has a full API reference.

I don't want to sound critical - I think the product looks great, but I don't see how people can get going with it.

Do you have plans to get the documentation up to a more comprehensive level?

Thanks a lot

Iain

Oct 14, 2010 at 6:03 PM

I am sorry for the difficulty. We will work on more documentation. There are some article on CodeProdject http://www.codeproject.com/info/search.aspx?artkw=nhydrate. Also there are some videos on YouTube http://www.youtube.com/nHydrate. 

Here is an example of creating an object with NHDAL. There is a "Package" table in the database and this code will create a new item and save it to the database. The objects are created using the factory pattern so you need a parent collection so you can create an object. The connection string is set in your app/web config file or using a static method.

//Add a new package to the collection
PackageCollection packageCollection = new PackageCollection();
Package package = packageCollection.NewItem();
package.Name = "MyNewPackage";
packageCollection.AddItem(package);
packageCollection.Persist();

I did not show EFDAL since this is just Entity Framework and there are plenty of examples on the Internet.

Oct 18, 2010 at 8:11 AM

Thanks, I look forward to seeing the new documentation. Unfortunately Youtube is blocked from work, so I've not been able to watch the videos there, and I've read the CodeProject articles.