I know that this code has a bit of smell but it suits this project in this specific implementation.
public class InvestmentAdvisorMap: ClassMap<InvestmentAdvisor>
{
public InvestmentAdvisorMap()
{
Id(x => x.EmployeeID).GeneratedBy.Assigned()
.Access.CamelCaseField(Prefix.Underscore);
Not.LazyLoad();
Table("Employee");
//need mapping to tierName here???? that links to join table
}
}
public class InvestmentAdvisor
{
private readonly Guid _employeeID;
private string _tierName;
public Tier Tier
{
get
{
switch (_tierName)
{
case "<$100K":
return Tier.LessThan100K;
case "$100K+":
return Tier.MoreThan100K;
case "$240K+":
return Tier.MoreThan240K;
case "$400K+":
return Tier.MoreThan400K;
case "$600K+":
return Tier.MoreThan600K;
case "$1M+":
return Tier.MoreThan1M;
default:
return Tier.LessThan100K;
}
}
}
public string TierName
{
get {
return _tierName;
}
}
public Guid EmployeeID
{
get { return _employeeID; }
}
}
}
I have a join table where there is a one to one relationship on tier where which has employeeID and TierName, I cant for the life of me figuire out how to do the Mapping class, basically a composite entity but not finding great examples
How about inheritancehirarchy?
and so on.