Skip to content
reddy6ue edited this page Sep 4, 2017 · 6 revisions

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