asp.net mvc - Entity Model, grouping models in one model file -



asp.net mvc - Entity Model, grouping models in one model file -

i have next code:

using system; using system.collections.generic; using system.linq; using system.web; using system.data.entity; namespace mytestwebsite.models { public class page { public int id { get; set; } public int authoruserid { get; set; } public string title { get; set; } public string description { get; set; } public string content { get; set; } public bool hidden { get; set; } } public class pagestate { public int id { get; set; } public string type { get; set; } } public class mytestwebsitedbcontext : dbcontext { public dbset<page> pages { get; set; } public dbset<pagestate> pagestates { get; set; } } }

i went create controller page , found model structure.. no problems.

this is, need model called pagestate , model list not show sec model.

is usual have heck load of models.... regardless of them beingness linked in way?

do add together model on own called pagestate?

is usual have heck load of models

yes, called view models. each view should have specific view model. it's normal have many view models if have many views. view model aggregate 1 or more of ef domain models.

asp.net-mvc entity-framework model

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -