this class is from http://wiki.fluentnhibernate.org/Getting_started it has some logic in it and I think this violates the Single Responsibility Principle, how do you think, how would you resolve this ?
Another thing that bothers me is why in nhibernate always it is being used IList and not IEnumerable which has less functionality ?
public class Store
{
public virtual int Id { get; private set; }
public virtual string Name { get; set; }
public virtual IList<Product> Products { get; set; }
public virtual IList<Employee> Staff { get; set; }
public Store()
{
Products = new List<Product>();
Staff = new List<Employee>();
}
public virtual void AddProduct(Product product)
{
product.StoresStockedIn.Add(this);
Products.Add(product);
}
public virtual void AddEmployee(Employee employee)
{
employee.Store = this;
Staff.Add(employee);
}
}