Let's say i got 2 entities - Foo and Bar. Foo is an aggregate root and contains Bar. As far as i understand, it should look like this:
public class Foo{
private readonly Bar Bar;
}
I want to provide functionality for users to choose Bars for Foos from a defined list (and change it).
If repositories are supposed to be for aggregate roots only it means that there will be no repository for Bar entity.
This leads to problem - Bar can't be created/updated independently without a reference to Foo.
Does that mean that Bar is supposed to have a repository despite that it has no meaning without a Foo?