I am fairly new to Fluent NHibernate. I was wondering if someone would please guide me into the right direction.
I have a class WorkDay, which represents every day of the week.
Table("WorkDays");
Id(x => x.ID).GeneratedBy.Identity();
Map(x => x.Date);
I am adding a new table Holidays, which stores all the holidays for the entire year.
CREATE TABLE [dbo].[Holidays]( [ID] [smalldatetime] NOT NULL, [Description] varchar NULL)
I have created a class Holidays:
public class Holiday: Entity<DateTime>
{
public virtual string Description { get; set; }
}
and mapped it:
public HolidayMap()
{
Table("Holidays");
Id(x => x.ID).GeneratedBy.Assigned();
Map(x => x.Description);
}
What is the best way to properly Reference and map the Holidays in the WorkDay in order to check if the specific day is a Holiday?
Thank you for your suggestions.