Omar,
Hello, thanks for the reply.
I am not certain that I understand your example.
Do you mean that you are extending methods to your entities to do things that affect more than just one entity?
Could you give me a little more code of how your extensions would be used?
My feeling after thinking about this a bit more is that extensions are just an alternate way to access my manager classes. so i can do things like user.Save and User.FillRoles which would fills the role collection of a user entity.
When i type User dot I want to see all the things that an instance of a user entity can do.
When I type UserManager dot I want to see everything that can be performed on users like returning new entities, or modifying several entities at once, and also simple things that can happen on a single instance.
I don't think I like this syntax of creating an empty container, then using extension methods of that to populate it. If i remember correctly i think this is how the self service worked.
Dim user as New UserEntity()
User.FetchByPrimaryKey(66) 'this would fetch and populate the current user.
'starbucks is an existing CompanyEntity instance
Dim users as EntityCollection(of UserEntities)
users.FetchByCompany(starbucks)
'here is one that may be a little more confusing using this syntax
dim user as new UserEntity()
user.Login(_userNameTextBox.Text, _passwordTextBox.Text)
' I think this is a bit clearer
dim user as UserEntity
user = UserManager.Login(_userNameTextBox.Text, _passwordTextBox.Text)
The reason I think this is because you can see that the Manager class is doing some work and populating the user with the results. There is no instance of the user until the login actually happens.
I am still working on getting my manager classes the way I would like them, but let me know if you are interested and I will send you one of my autogenerated classes.
Gabe