Hello All
I'd like to have an 'UnassignedDepartment' object instead of letting employees have a null Department:
public class UnassignedDepartment : Department
{
public UnassignedDepartment() : base("not yet assigned") {
Id = -99; <-- just some Id that can be held constant, not be generated..
}
}
This is accessible by a static convenience field in the Department class:
public class Department : Entity
{
public static readonly Department UNASSIGNED = new UnassignedDepartment();
....
}
I'm using S#rpArch's framework as the base Entity, with a mix of FNH automapping, overrides & conventions. From a persistence standpoint, it seems logical to keep this with the other Departments with a 'special' Id, but I don't know how to do that properly. Please enlighten me!
Thx, Berryl