DDD Factory Responsibility
<p>If have the following Code.</p>

<pre><code>public class CountryFactory : IEntityFactory
{
    private readonly IRepository&lt;Country&gt; countryRepository;

    public CountryFactory(IRepository&lt;Country&gt; countryRepository)
    {
        this.countryRepository = countryRepository;
    }

    public Country CreateCountry(string name)
    {
        if (countryRepository.FindAll().Any(c =&gt; c.Name == name))
        {
            throw new ArgumentException("There is already a country with that name!");
        }

        return new Country(name);
    }
}
</code></pre>

<p>From a DDD approach, is the the correct way to create a <code>Country</code>. Or is it better to have a <code>CountryService</code> which checks whether or not a country exists, then if it does not, just call the factory to return a new entity. This will then mean that the service will be responsible of persisting the Entity rather than the Factory.</p>

<p>I'm a bit confused as to where the responsibility should lay. Especially if more complex entities needs to be created which is not as simple as creating a country.</p>