You can use  DiscriminatorValue<int> = 3

On Aug 17, 5:13 pm, James Gregory <[email protected]> wrote:
> Hmm, you should just be able to put the number in a string. "1", "2" etc...
> Shouldn't need to do that mind, but it should work.
>
>
>
> On Mon, Aug 17, 2009 at 3:08 PM, Martin Nyborg <[email protected]> wrote:
>
> > Yes there are but it only takes a string
>
> > On Aug 17, 3:50 pm, James Gregory <[email protected]> wrote:
> > > Off the top of my head, I think there's a DiscriminatorValue method in
> > > SubclassMap.
>
> > > On Mon, Aug 17, 2009 at 1:59 PM, Martin Nyborg <[email protected]>
> > wrote:
>
> > > > Ups I hit the return key. I try again
>
> > > > To start with, yes I have read the wiki :-)
>
> > > > And congratulation with the release. Fluent NHibernate is very
> > > > importing for me and my team.
>
> > > > here is the code I am trying to convert to SubclassMap
>
> > > > DiscriminateSubClassesOnColumn<int>("SiteTypeDiscriminator", 0)
> > > >           .SubClass<SiteNCP>(1, SiteNcpAction)
> > > >           .SubClass<SiteCandidate>(2, SiteCandidateAction)
> > > >           .SubClass<SiteForeignOperators>(3, m =>{});
> > > >      }
>
> > > >      private void SiteNcpAction(SubClassPart<SiteNCP> obj)
> > > >      {
> > > >         obj.HasMany(x => x.InternalCandidates).KeyColumns.Add
> > > > ("ParentSiteId").Not.LazyLoad();
> > > >      }
>
> > > > I have created a SubclassMap for the SiteNCP but how can I tell that
> > > > the SiteTypeDiscriminator=1
>
> > > > public class SiteNCPMap : SubclassMap<SiteNCP>
> > > >   {
> > > >      public SiteNCPMap()
> > > >      {
> > > >       //SiteTypeDiscriminator=1
> > > >         HasMany(x => x.InternalCandidates).KeyColumns.Add
> > > > ("ParentSiteId").Not.LazyLoad();
> > > >       }
> > > >   }
>
> > > > On Aug 17, 2:53 pm, mhnyborg <[email protected]> wrote:
> > > > > To start with, yes I have read the wiki :-)
>
> > > > > And congratulation with the release. Fluent NHibernate is very
> > > > > importing for me and my team.- Hide quoted text -
>
> > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" 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/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to