I'm not sure how I would do this. Any help would be appreciated.
Basically I am trying to create a mapping for 2 tables to create 1
entity called School. Below are the table schemas and my entity im
trying to map to. SchoolSystemID is not unique. Meaning each School
can have one SchoolSystem and a SchoolSystem can belong to multiple
Schools.
-----------------------------------------------------------------------------------------
CREATE TABLE [dbo].[School](
[SchoolID] [int] IDENTITY(1,1) NOT NULL,
[SchoolSystemID] [int] NOT NULL,
[SchoolName] [varchar](50) NOT NULL,
)
GO
ALTER TABLE [dbo].[School] WITH CHECK ADD FOREIGN KEY
([SchoolSystemID])
REFERENCES [dbo].[SchoolSystem] ([SchoolSystemID])
-------------------------------------------------------------------------------------------
CREATE TABLE [dbo].[SchoolSystem](
[SchoolSystemID] [int] IDENTITY(1,1) NOT NULL,
[CountyName] [varchar](50) NOT NULL,
[SchoolSystemName] [varchar](50) NOT NULL,
)
ALTER TABLE [dbo].[SchoolSystem] WITH CHECK ADD FOREIGN KEY
([CountyName])
REFERENCES [dbo].[County] ([CountyName])
-------------------------------------------------------------------------------------------
public class School
{
public virtual int ID { get; set; }
public virtual string Name { get; set; }
public virtual string CountyName { get; set; }
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" 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/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---