• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

Question on "Type Inaccessible due to its protection level"

I received a compile error message:
Error message:     iHITSLegalTemplate is inaccessible due to its protection level.

However, the code does not limit any access to the type iHITSLegalTemplate. Anyone may provide any clue?


namespace myNamespace.Common
class iHITSLegalTemplate : BaseEntity
    {
        #region Variables


        #endregion

        #region Constructors

            public iHITSLegalTemplate(object id, object entityObjectTypeID)
                  : base(id, entityObjectTypeID)
            {
                  VerifyObjectType((EntityObjectType)Convert.ToInt32(entityObjectTypeID));
            }

        public iHITSLegalTemplate(object id, object entityObjectTypeID, object status, object lastUpdateBy, object lastUpdatedDate)
                  : base(id, entityObjectTypeID, status, lastUpdateBy, lastUpdatedDate)
            {
                  VerifyObjectType((EntityObjectType)Convert.ToInt32(entityObjectTypeID));
            }

            #endregion

........
}


namespace myNamespace.Data
    class iHITS
    {

        public static iHITSLegalTemplate GetLegalTemplate(int templateID, bool includeDetails)
{
                        iHITSLegalTemplate entity = null;
                        ...............
                        return entity;
}

}

0
chuang4630
Asked:
chuang4630
  • 3
  • 2
1 Solution
 
strickddCommented:
Try this for the code below the "......."


namespace myNamespace.Data
 PUBLIC   class iHITS
    {

        public static iHITSLegalTemplate GetLegalTemplate(int templateID, bool includeDetails)
{
                        iHITSLegalTemplate entity = null;
                        ...............
                        return entity;
}

}
0
 
chuang4630Author Commented:
Try this for the code below the "......." ?

That is "return entity; ".  I don't see any code difference.


I did saw that you add PUBLIC to the class, I tried, it does not help.

0
 
strickddCommented:
I put PUBLIC in all caps to point out what I changed, did you try putting the proper casing for C#?
0
 
chuang4630Author Commented:
I fixed it. PUBLIC should be added here:

PUBLIC class iHITSLegalTemplate : BaseEntity
0
 
strickddCommented:
Give that a try, it might work.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now