for now I have this context
namespace Dafoor_MVC.Models
{
public class DafoorDBContext : DbContext
{
public DbSet<Department> departments { get; set; }
public DbSet<Course> courses { get; set; }
public DbSet<Reply> replies { get; set; }
}
}
This context will grow large because I have about 40 models that I wanna add.
1- is it a good idea to have the 40 models in one context ?
2- i want this context to be shared among all users, because i don't want to hit the database with queries every time if the record is already in a context, but this will affect the server memory,so how can i implement something like " last object used to be disposed or the object that didn't get called for an amount of time to be disposed from the context " ? i don't want to dispose the whole context.
3-if point 2 didn't work, can i put an instance of the context in a user session so the context will be a user specific not application spicific