department.AddUnit(new Unit());
department.RemoveUnit(someUnit);
...and handle the birefs inside these methods.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
Personally I don’t think so. What about PI for transient entities? I think this should be a domain concern.
Or am I missing how you think this should be solved on newly created entities?
/Roger
Thought you meant to to put this collection in core. What I meant with the "PI" was persistance ignorance if this was a NH Core collection needed to be instantiated in domain on transient entities.
________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Fabio Maulo [fabio...@gmail.com]
Skickat: den 3 juni 2010 17:44
Till: nhu...@googlegroups.com
Ämne: Re: [nhusers] Beginners question: How to add or delete related entity
To try to be a little more clear (and try to use this group even for ideas, not only for NH-Core)...
What is completely possible, without touch NH core, is:
To avoid the implementation of specific methods to Add/Remove children from a collection of Parent-Child relation we can provide "the final cut": strongly typed safe an encapsulated collection to manage Parent-Child relationship.
A little project with those classes with reference only to .NET.
Another project with IUserCollectionType to work with NH.
In this way the user can expose ICollection<TChild> instead IEnumerable<TChild>.
public Order()
{
Items= new ParentChildBag<Order, OrderItem>(this);
}
public ICollection<OrderItem> Items {get; private set;}
In the other prj we will have PersistentParentChild<TParent, TChild> with the implementation for NH.
With XML mapping you know that the work is easy.
With FNH you can do the same as in XML or with a convetion.
With ConfORM I can implements a simple pattern.
Perhaps we can avoid a hundred of questions about Parent-Child relationship issues giving a cooked and strongly-typed/generic solution for new users ;)
On Thu, Jun 3, 2010 at 10:57 AM, Roger Kratz <Roger...@teleopti.com<mailto:Roger...@teleopti.com>> wrote:
Personally I don’t think so. What about PI for transient entities? I think this should be a domain concern.
Or am I missing how you think this should be solved on newly created entities?
/Roger
From: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com> [mailto:nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>] On Behalf Of Fabio Maulo
Sent: den 3 juni 2010 14:19
To: nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>
Subject: Re: [nhusers] Beginners question: How to add or delete related entity
Roger...
Perhaps we should implements a custom ParentChildSet and ParentChildBag somewhere ?
What do you think ?
department.AddUnit(new Unit());
department.RemoveUnit(someUnit);
To post to this group, send email to nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com<mailto:nhusers%2Bunsu...@googlegroups.com>.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com<mailto:nhusers%2Bunsu...@googlegroups.com>.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
Fabio Maulo
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com<mailto:nhusers%2Bunsu...@googlegroups.com>.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com<mailto:nhusers%2Bunsu...@googlegroups.com>.
Ah! You didn't mean to put this collection in NH Core? Sounds just fine.
Thought you meant to to put this collection in core. What I meant with the "PI" was persistance ignorance if this was a NH Core collection needed to be instantiated in domain on transient entities.