Property cannot be declared public because its type uses an internal type

You have to declare the access level of the Content class public as well.

public class Content {
   // some code
}

As stated in the documentation:

A public variable cannot be defined as having an internal or private
type, because the type might not be available everywhere that the
public variable is used.

Classes are declared as internal by default, so you have to add the public keyword to make them public.

A similar rule exists for functions as well.

A function cannot have a higher access level than its parameter types
and return type, because the function could be used in situations
where its constituent types are not available to the surrounding code.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)