0

I have a flat view that consists of columns such as:

ResultID
ResultName
ResultTime
DisciplineCode
DisciplineName
DateModified

etc...

I have a Result class that currently matches the above schema (flat)

public class Result
{
    public virtual string ResultID { get; set; }
    public virtual string ResultName { get; set; }
    public virtual decimal ResultTime { get; set; }
    public virtual string DisciplineCode { get; set; }
    public virtual string DisciplineName { get; set; }
    public virtual DateTime DateModified { get; set; }
}

What I'd like, is to separate my Discipline properties into their own class like this:

public class Discipline
{
    public virtual string DisciplineCode { get; set; }
    public virtual string DisciplineName { get; set; }
}

And then change my Result class to:

public class Result
{
    public virtual string ResultID { get; set; }
    public virtual string ResultName { get; set; }
    public virtual decimal ResultTime { get; set; }
    public virtual Discipline Discipline { get; set; }
    public virtual DateTime DateModified { get; set; }
}

So that the Discipline is embedded as a class.

The details come from the same table (or in my case, normalized view)

How can I map this with fluent nHibernate

I've looked at References, but not sure if that's right?

Alex
  • 37,502
  • 51
  • 204
  • 332

1 Answers1

0

Component sorted this.

Didn't realize I'd actually asked this question already a few days ago (in a different form)

See my answer here - https://stackoverflow.com/a/11397884/131809

Community
  • 1
  • 1
Alex
  • 37,502
  • 51
  • 204
  • 332