Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • 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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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