Well, there's no need for the RelatedEntityId to also be a property in the
Entity class. Because the RelatedEntity class should have it's own ID (say
you call it RelatedEntityId as a property in that classes mapping). So you
should be able to retrieve an Entity, and do
Entity.RelatedEntity.RelatedEntityId.

On Tue, Oct 27, 2009 at 3:58 AM, Mohamed Meligy <eng.mel...@gmail.com>wrote:

> Hello,
> Let's say I want to have many-to-one relation like:
>
> public class Entity
>> {
>>     public long EntityId {get;set;}
>>     public long RelatedEntityId {get;set;}
>>     public OtherEntity RelatedEntity {get;set;}
>> }
>>
>
> The reason I want to have RelatedEntityId is because, in my scenario, I
> expect to need ONLY the ID of the other entity withough needing to load it
> at all.
>
> Can I do that?
>
> Thank you.
> Regards,
>
> --
> Mohamed Meligy
> Information Analyst (.Net Technologies) – Applications Delivery - TDG
> Injazat Data Systems
> P.O. Box: 8230 Abu Dhabi, UAE.
>
> Phone:  +971 2 6992700
> Direct:   +971 2 4045385
> Mobile:  +971 50 2623624, +971 55 2017 621
>
> E-mail: eng.mel...@gmail.com
> Weblog: http://weblogs.asp.net/meligy
>
> >
>


-- 
- Hudson
http://www.bestguesstheory.com
http://twitter.com/HudsonAkridge

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to