mas*_*ani 4 c# oop getter protected public
如果我们将属性定义为属性,public并且在此属性中我们有一个protectedgetter.这是什么意思?如果属性是公共的,为此定义受保护的getter是什么意思?请看下面的代码:
public ISessionFactory SessionFactory
{
protected get { return sessionFactory; }
set { sessionFactory = value; }
}
Run Code Online (Sandbox Code Playgroud)