Skip to content

Creating Repositories

Eros Stein edited this page Jan 8, 2017 · 3 revisions
  1. Right-click your Repositories folder inside the Domain project and select Add > New Item
  2. Select Blayer and choose Repository
  3. Use the same name you used for the POCO class screen shot 2017-01-06 at 17 01 51

A file is created with a similar content to this one:

using Blayer.Data;

namespace Your.Namespace.Domain.Repositories
{
    public class StateRepository : Repository<State>
    {
    }
}

If you created a POCO project, which you should've :), you must add this using:

using Your.Namespace.Poco;

After creating a repository we need to add it to our repository configuration class. For example:

public class AppConfiguration : RepositoryConfiguration
{
    public StateRepository StateRepository;
}

Now Blayer.Data knows about StateRepository.

This is it for now, in other sections, when we start to work with customizations, we'll come back to this file and update it.

Clone this wiki locally