To make data-layer be aware of my domain classes, I've added a reference between the two class libraries, HMSContext
(i.e., data-layer) and Hms.Entities
(i.e., domain-classes).
Following is code from HMS.Entities
:
namespace HMS.Entities
{
class Accomodation
{
public int ID { get; set; }
public int AccomodationPackageID { get; set; }
public AccomodationPackage AccomodationPackage { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
}
Code from HMSContext.cs
:
using System.Data.Entity;
namespace HMS.Data
{
public class HMSContext : DbContext
{
public DbSet<Accomodation> Accomodations { get; set; }
}
}
I've added a reference between these two .dlls. A snapshot showing this is attached here. For some reason, HRMContext.cs
is not reading HMS.Entities
despite added reference. Am I missing anything? Can someone please shed light on this. Thanks in advance.