Thanks Jason. Your answer looks to be what I was looking for :) Though I
didn't tested it yet.
Thank you very much again.

On Thu, Jan 20, 2011 at 8:55 PM, Jason Meckley <[email protected]>wrote:

> if you mean to load all the locals any time you query the primary entity,
> that's a preformance problem waiting to happen. now it may work if you
> introduce a filter which can be set right after the session opens. this way
> only a single result is returned per localized resource. it would also bleed
> into your domain model.
>
> //class
> private ISet<string> localizedvalues;
> public string Value{get{return localizedvalues.FirstOrDefault();}}
>
> //mapping
> <class name="myentity">
>    <set name="localizedvalues" access="field" lazy="false" join="fetch">
>          <filter name="CultureFilter" />
>          ...
>    </set>
> </class>
> <filter-def name="CultureFilter" condition="cultureId = :culture">
>    <param name="culture" type="string" />
> </filter-def>
>
> //session configuration
> var session = factory.Open();
> session.EnableFilter("CultureFilter").SetParameter("culture", Thread.
> CurrentThread.CurrentCulture.LCID);
>
> this is similar to how ayende's examples works, except we are using a set
> instead of a formula to pull the locale.
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to