Getting Started

For up-front configuration purposes that will become clear, AutoPoco has the following steps involved in use:

1) Configuring a factory

IGenerationSessionFactory factory = AutoPocoContainer.Configure(x =>
{
    x.Conventions(c =>
    {
        c.UseDefaultConventions();
    });
    x.AddFromAssemblyContainingType<SimpleUser>();
});

2) Get a session from that factory

IGenerationSession session = factory.CreateSession();

3) Create objects

SimpleUser user = session.Single<SimpleUser>().Get();
List<SimpleUser> users = session.List<SimpleUser>(100).Get();

Further Reading

  • Read more about configuration here
  • Read more about conventions here
  • Read more about factories/sessions here
  • Read more about Object Generation here

Last edited Apr 15, 2010 at 9:38 AM by robashton, version 14

Comments

No comments yet.