JakeS
unread,Aug 19, 2009, 12:14:36 PM8/19/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Castle Project Users
I've got an inherited object defined like this:
[ActiveRecord("CompanyUsers",
DiscriminatorColumn = "type",
DiscriminatorType = "String",
DiscriminatorValue = "CompanyUser")]
public abstract class UserBase : ModelBase<UserBase>
{
// some props and methods
}
[ActiveRecord(DiscriminatorValue = "TechnicianUser")]
public class Technician : UserBase
{
// other props
private IList<ScheduledInstall> _scheduledInstalls= new
List<ScheduledInstall>();
[HasMany(typeof(ScheduledInstall), Table = "ScheduleForTech",
ColumnKey = "ScheduleID", Inverse=true)]
public IList<ScheduledInstall> Schedule
{
get
{
if(_scheduledInstalls==null){_scheduledInstalls=new
List<ScheduledInstall>();}
return _scheduledInstalls;
}
set
{
_scheduledInstalls = value;
}
}
}
And then the ScheduledInstall class references the Technician like
this:
[ActiveRecord]
public class ScheduledInstall : ModelBase<ScheduledInstall>
{
[BelongsTo("TechnicianID")]
public Technician Technician { get; set; }
}
But when I run Castle.ActiveRecord.ActiveRecordStarter.CreateSchema(),
it's not creating the ScheduleForTech table like I expected. Can
someone help me figure out what I'm doing wrong?