asp.net mvc - Inconsistent accessibility: property type in DbContext -


i have added dbset in context i.e.

 public dbset<demo> demo{ get; set; } 

but getting compilation error here i.e.

error   1   inconsistent accessibility: property type 'system.data.entity.dbset<mvc.model.demo>' less accessible property 'mvc.model.demo'  d:files/project 210 34  mvc.data 

here model:-

class demo     {         [key]         [display(name = "id", resourcetype = typeof(resources.resource))]         public long id { get; set;}          [display(name = "countryid", resourcetype = typeof(resources.resource))]         public long countryid { get; set; }          [display(name = "rightid", resourcetype = typeof(resources.resource))]         public long rightid { get; set; }          [display(name = "amount", resourcetype = typeof(resources.resource))]         public double amount { get; set; }     } 

demo has no access modifier , classes internal default, less accessible dbset demo public. also, should call dbset demos not confuse 2 , since semantically holds set of demos.

since set public:

 public dbset<demo> demo { get; set; } 

you need make demo class public well:

public class demo {      .... } 

as mentioned, suggest change set to:

public dbset<demo> demos { get; set; } 

so don't confuse set class type.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -