I need to clarify something.
Does the person have Aggreagate, 2 VO (Country, StateProvince).
I want to load the whole country in my view layer (I use mvc)
Evan says that you use the repository (IPersonRepository) to work with the root entity (it should always return only a reference to the shared array)
public interface IPersonRepository() { void savePerson(Person p); void removePerson(Person p); Ilist<Person> getPerson(); }
what I usually do to solve this problem:
Add this method to IPersonRepository
IList<Country> LookupCountrysOfPerson();
At the Infra level, implement domain interfaces, for example:
public IList<Person> LookupCountrysOfPerson() { return Session.CreateQuery("from Countrys").List<Person>()); }
My partner says itβs wrong.
Sometimes you have to sacrifice your domain model to complete some task.
What is the best way to do this?
with the code please! :)
source share