Note that there are some explanatory texts on larger screens.

plurals
  1. POc# Object Oriented Programming issue
    primarykey
    data
    text
    <pre><code>class Program { static void Main(string[] args) { Master m = new Master(37); Content c = new Content(m); } } </code></pre> <p>I have two classes defined. The first as follow:</p> <pre><code>internal class Content { private Master _parentMaster; private Content _contentChildren; #region Constructor internal Content(Master master) { this._parentMaster = master; } internal Content(Master master, long contentId) { this._parentMaster = master; _getContent(contentId); } #endregion #region Private Methods private void _getContent(long contentId) { contentRepository.getContent(contentId, _parentMaster.MasterId); } #endregion #region Internal Methods internal void AddContent() { // code omitted } internal void UpdateContent() { // code omitted } internal void GetChildren() { // code imitted } internal void GetRootContent() { // code omitted } #endregion #region Properties // code omitted #endregion } </code></pre> <p>and the second one:</p> <pre><code>public class Master { private MasterEntities _master; private List&lt;Master&gt; _masters; #region Constructor internal Master() { _master = new MasterEntities(); } internal Master(long masterId) { _getMaster(masterId); } #endregion #region Private Methods internal void _getMaster() { // code omitted } #region Properties internal long MasterId { get { return _master.id; } set { _master.id = value; } } // code omitted #endregion } </code></pre> <p>Is this the correct way to implement the two classes? Or will be better to implement Nested Classes? If yes, how to get the same result stated in "Main" with nested classes?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload