User-734459410 posted
When creating model classes in a project that is using code-first with E-F, does E-F only create database entities for classes that you have defined a DbSet for? For example, if I had the following segment (assuming Picture, Album, and Picture_Album
are all data model classes that I've defined as Public classes:
public DbSet<Picture> Pictures { get; set; }
public DbSet<Album> Albums { get; set; }
public List<Picture_Album> Pictures_Albums { get; set; }
E-F would only create tables for the Picture and Album classes, correct? Since I defined DbSets for those classes, and it would ignore the Picture_album list (which that table would be used internally in memory and not need to be stored in the database
as a table, since it's not defined with a DbSet.
I basically need to be able to create "view models" (like you find in MVC) for storing data in memory that does not need to be persisted/written to the database. I'm also doing this mostly in code, and not using the EDMX designer/wizard (I don't think
that matters though).