I have a very simple model that maps to a single table (Projects) in my database. I decided to abstract the images in my class.
public class Project
{
public long Id { get; set; }
public string Name { get; set; }
public Image Images { get; set; }
}
public class Image
{
public string Thumbnail { get; set; }
public string PrimaryImage { get; set; }
}
How can I connect my model to a table in the database using the following code:
public class Context : DbContext
{
public DbSet<Project> Projects { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
????
}
}
thank
source
share