I've got a system that allows either individual users or entire teams
to bid on projects. I'm trying to model the relationship based on an
"IProjectBidder" relationship, but I'm missing something...
[ActiveRecord]
public class User: ModelBase<User>, IProjectBidder
{
private IList<ProjectBid> _projectBids;
[HasMany(typeof(ProjectBid), Lazy=true)]
public IList<ProjectBid> ProjectBids
{
get
{
if(_projectBids==null){_projectBids=new List<ProjectBid>();}
return _projectBids;
}
set { _projectBids = value; }
}
}
[ActiveRecord]
public class Team: ModelBase<Team>, IProjectBidder
{
private IList<ProjectBid> _projectBids;
[HasMany(typeof(ProjectBid), Lazy=true)]
public IList<ProjectBid> ProjectBids
{
get
{
if(_projectBids==null){_projectBids=new List<ProjectBid>();}
return _projectBids;
}
set { _projectBids = value; }
}
}
[ActiveRecord]
public class ProjectBid : ModelBase<ProjectBid>
{
[Any(typeof(int),MetaType = typeof(string), TypeColumn =
"BidderType", IdColumn = "BidderID")]
[Any.MetaValue("USER", typeof(User))]
[Any.MetaValue("TEAM", typeof(Team))]
public IProjectBidder Bidder { get; set; }
}
When I try to initializa activerecord I get the error-- "ActiveRecord
tried to infer details about the relation Team.ProjectBids but it
could not find a 'BelongsTo' mapped property in the target type
Core.Models.BiddingProcess.ProjectBid".
Am I missing something simple? I used [Any] mapping in my last
project, but I didn't try to get the both sides of the relationship
mapped like this.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---